get_ellipse: Calculate ellipse polygon coordinates from foci and...

View source: R/utils.R

get_ellipseR Documentation

Calculate ellipse polygon coordinates from foci and eccentricity

Description

TODO calculate ellipse polygon coordinates from foci and eccentricity.

Usage

get_ellipse(f1 = c(-3, 0), f2 = c(3, 0), ecc = 0.8, n = 100)

Arguments

f1

x- and y-coordinates of the first focus.

f2

x- and y-coordinates of the second focus.

ecc

eccentricity of the ellipse, defined as half the distance between foci divided by the semi-major axis. We can say e = sqrt{1 - b^2/a^2}, where e is the eccentricity, a is the length of the semi-major axis, and b is the length of the semi-minor axis. Eccentricity ranges from 0 (perfect circle) to 1 (straight line between foci), although eccentricity of 0 is not allowed in this function as it would lead to an infinitely large circle.

n

number of points in polygon.


mrc-ide/genescaper documentation built on May 25, 2022, 10:46 p.m.