Skip to main content
Version: Next

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坐标系中心点
xSemiAxisnumbersemi (major) axis of the ellipse along the x-axis
ySemiAxisnumbersemi (minor) axis of the ellipse along the y-axis
options?对象可选参数(默认
options.angle?numberangle of rotation in decimal degrees, positive clockwise (default 0)
options.pivot?坐标系point around which any rotation will be performed (default center)
options.steps?numbernumber of steps (default 64)
options.units?stringunit 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(...);