ellipse
描述
¥Description
获取一个 点 对象,并根据两个半轴(以可变单位和步长表示,精度取决于步长)计算椭圆多边形。
¥Takes a Point and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
center | 坐标系 | 中心点 |
xSemiAxis | number | 椭圆沿 x 轴的半轴(长轴) |
ySemiAxis | number | 椭圆沿 y 轴的半轴(短轴) |
options? | 对象 | 可选参数(默认 {}) |
options.angle? | number | 以十进制度数表示的旋转角度,顺时针方向为正(默认为 0) |
options.pivot? | 坐标系 | 旋转将围绕其执行的点(默认中心) |
options.steps? | number | 步数(默认值 64) |
options.units? | string | 坐标轴的测量单位(默认 'kilometers') |
options.properties? | 对象 | 属性(默认 {}) |
返回
¥Returns
¥Feature<Polygon> ellipse polygon
示例
¥Examples
var center = [-75, 40];
var xSemiAxis = 5;
var ySemiAxis = 2;
var ellipse = turf.ellipse(center, xSemiAxis, ySemiAxis);
安装
¥Installation
$ npm install @turf/ellipse
import { ellipse } from "@turf/ellipse";
const result = ellipse(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.ellipse(...);