Skip to main content
Version: 7.2.0

ellipse

描述

¥Description

获取一个 对象,并根据两个半轴(以可变单位和步长表示,精度取决于步长)计算椭圆多边形。

¥Takes a Point and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.

参数

¥Parameters

名称类型描述
center坐标系中心点
xSemiAxisnumber椭圆沿 x 轴的半轴(长轴)
ySemiAxisnumber椭圆沿 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(...);