Skip to content

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

Coord

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?

Units

unit of measurement for axes. Supports all valid Turf Units

angle?

number

angle of rotation in decimal degrees, positive clockwise

pivot?

Coord

point around which any rotation will be performed

properties?

GeoJsonProperties

properties

返回

Feature<Polygon>

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]

KBE3D @3.0.0 Copyright © 2024-present KBE3D