Calculate ellipse polygon coordinates from foci and eccentricity.
1 | get_ellipse(f1 = c(-3, -2), f2 = c(3, 2), ecc = 0.8, n = 100)
|
f1 |
x- and y-coordinates of the first focus. |
f2 |
x- and y-coordinates of the first 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 between 0 (perfect circle) and 1 (straight line between foci). |
n |
number of points in polygon. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.