Skip to main content
Version: 7.3.0

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

Feature<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(...);