sector
Description
Creates a circular sector of a circle of given radius and center Point, between (clockwise) bearing1 and bearing2; 0 bearing is North of center point, positive clockwise.
Parameters
Name | Type | Description |
---|---|---|
center | Coord | center point |
radius | number | radius of the circle |
bearing1 | number | angle, in decimal degrees, of the first radius of the sector |
bearing2 | number | angle, in decimal degrees, of the second radius of the sector |
options? | Object | Optional parameters (default {}) |
options.units? | string | miles, kilometers, degrees, or radians (default 'kilometers') |
options.steps? | number | number of steps (default 64) |
options.properties? | Properties | Translate properties to Feature Polygon (default {}) |
Returns
Feature<Polygon> sector polygon
Examples
var center = turf.point([-75, 40]);
var radius = 5;
var bearing1 = 25;
var bearing2 = 45;
var sector = turf.sector(center, radius, bearing1, bearing2);
Installation
$ npm install @turf/sector
import { sector } from "@turf/sector";
const result = sector(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.sector(...);