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