Skip to main content
Version: Next

circle

Description

Takes a Point and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.

Parameters

NameTypeDescription
centerFeature<Point> | Array<number>center point
radiusnumberradius of the circle
options?ObjectOptional parameters (default {})
options.steps?numbernumber of steps (default 64)
options.units?stringmiles, kilometers, degrees, or radians (default 'kilometers')
options.properties?Objectproperties (default {})

Returns

Feature<Polygon> circle polygon

Examples

var center = [-75.343, 39.984];
var radius = 5;
var options = { steps: 10, units: "kilometers", properties: { foo: "bar" } };
var circle = turf.circle(center, radius, options);

Installation

$ npm install @turf/circle

import { circle } from "@turf/circle";
const result = circle(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.circle(...);