ellipse
Description
Takes a Point and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.
Parameters
| Name | Type | Description |
|---|---|---|
| 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? | Object | Optional parameters (default {}) |
| options.angle? | number | angle of rotation in decimal degrees, positive clockwise (default 0) |
| options.pivot? | Coord | point around which the rotation will be performed (default 'origin') |
| options.steps? | number | number of steps (default 64) |
| options.units? | string | unit of measurement for axes (default 'kilometers') |
| options.properties? | Object | properties (default {}) |
Returns
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(...);