Skip to main content
Version: Next

ellipse

Description

Takes a Point and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.

Parameters

NameTypeDescription
centerCoordcenter point
xSemiAxisnumbersemi (major) axis of the ellipse along the x-axis
ySemiAxisnumbersemi (minor) axis of the ellipse along the y-axis
options?ObjectOptional parameters (default {})
options.angle?numberangle of rotation in decimal degrees, positive clockwise (default 0)
options.pivot?Coordpoint 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?Objectproperties (default {})

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