Skip to main content
Version: 7.3.0

circle

描述

¥Description

接受一个 ,并计算给定半径 单位 的圆多边形;步长(用于确定精度)。

¥Takes a Point and calculates the circle polygon given a radius in Units; and steps for precision.

参数

¥Parameters

名称类型描述
center特性<> | 数组<number>中心点
radiusnumber圆的半径
options?对象可选参数(默认值:
options.steps?number步数(默认值 64)
options.units?单位支持所有有效的 Turf 单位(默认为 'kilometers')
options.properties?对象属性(默认值:

返回

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