ellipse
描述
¥Description
Takes a 点 and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.
¥Takes a Point and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
center | 坐标系 | 中心点 |
xSemiAxis | number | semi (major) axis of the ellipse along the x-axis |
ySemiAxis | number | semi (minor) axis of the ellipse along the y-axis |
options? | 对象 | 可选参数(默认 ) |
options.angle? | number | angle of rotation in decimal degrees, positive clockwise (default 0) |
options.pivot? | 坐标系 | point around which any rotation will be performed (default center) |
options.steps? | number | number of steps (default 64) |
options.units? | string | unit of measurement for axes (default '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(...);