Skip to main content
Version: 7.3.0

sector

描述

🌐 Description

创建一个给定半径和中心点 Point 的圆的圆扇形,位于(顺时针)方位角1和方位角2之间;方位角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

名称类型描述
居中坐标中心点
半径数字圆的半径
bearing1number扇区第一条半径的角度,十进制度数
bearing2数字扇形第二条半径的角度,十进制度数
options?对象可选参数 (默认 {})
options.units?单位支持所有有效的 Turf 单位 (默认 '公里')
options.steps?数字步数 (默认 64)
options.properties?属性将属性转译为要素多边形 (默认 {})

返回

🌐 Returns

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