Skip to main content
Version: Next

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

NameTypeDescription
centerCoordcenter point
radiusnumberradius of the circle
bearing1numberangle, in decimal degrees, of the first radius of the sector
bearing2numberangle, in decimal degrees, of the second radius of the sector
options?ObjectOptional parameters (default {})
options.units?stringmiles, kilometers, degrees, or radians (default 'kilometers')
options.steps?numbernumber of steps (default 64)
options.properties?PropertiesTranslate properties to Feature Polygon (default {})

Returns

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(...);