get_ellipse | R Documentation |
TODO calculate ellipse polygon coordinates from foci and eccentricity.
get_ellipse(f1 = c(-3, 0), f2 = c(3, 0), ecc = 0.8, n = 100)
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. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.