Skip to main content
Version: Next

sector

描述

¥Description

Creates a circular sector of a circle of given radius and center , between (clockwise) bearing1 and bearing2;0 方位角表示中心点以北,顺时针为正方向。

¥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

名称类型描述
center坐标系中心点
radiusnumber圆的半径
bearing1numberangle, in decimal degrees, of the first radius of the sector
bearing2numberangle, in decimal degrees, of the second radius of the sector
options?对象可选参数(默认
options.units?stringmiles, kilometers, degrees, or radians (default 'kilometers')
options.steps?numbernumber of steps (default 64)
options.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(...);