Appearance
KBE3D / KBCore / turf / ellipse
函数: ellipse()
ellipse(
center:Coord,xSemiAxis:number,ySemiAxis:number,options?: {steps?:number;units?:Units;angle?:number;pivot?:Coord;properties?:GeoJsonProperties; }):Feature<Polygon>
Takes a Point and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.
参数
center
center point
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?
Optional parameters
steps?
number
number of steps
units?
unit of measurement for axes. Supports all valid Turf Units
angle?
number
angle of rotation in decimal degrees, positive clockwise
pivot?
point around which any rotation will be performed
properties?
properties
返回
ellipse polygon
示例
ts
var center = [-75, 40];
var xSemiAxis = 5;
var ySemiAxis = 2;
var ellipse = turf.ellipse(center, xSemiAxis, ySemiAxis);
//addToMap
var addToMap = [turf.point(center), ellipse]