ellipse
描述
🌐 Description
接受一个 Point 并计算给定两个以变量单位表示的半轴和精度步数的椭圆多边形。
🌐 Takes a Point and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| center | Coord | 中心点 |
| xSemiAxis | number | 椭圆沿 x 轴的半(长)轴 |
| ySemiAxis | number | 椭圆沿y轴的半(短)轴 |
| options? | Object | 可选参数 (默认 {}) |
| options.angle? | number | 旋转角度(十进制度),顺时针为正 (默认 0) |
| options.pivot? | Coord | 进行任何旋转的中心点 (默认中心) |
| options.steps? | number | 步骤数 (默认 64) |
| options.units? | Units | 用于轴的计量单位。支持所有有效的 Turf Units (默认 '公里') |
| options.properties? | Object | 属性 (默认 {}) |
返回
🌐 Returns
示例
🌐 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(...);