The ellipse is a curved line forming a closed loop, where the sum of the distances from two points (foci) to every point on the line is constant.
We can generate an SVG ellipse 2 ways: using the 'ellipse' shape command, or using a 'path' command.
Some Ellipse Terms and Formulae
- F = distance from each focus to center on the major axis
- R₁ = major axis (a line through both foci)
- R₂ = minor axis (a line perpendicular to major axis through the center)
- a = semi-major axis (R₁ / 2)
- b = semi-minor axis (R₂ / 2)
- C = center of ellipse
- (x/a)² + (y/b)² = 1
- x = acosθ, y = bsinθ
- Eccentricity (e): how much the curve deviates from being circular.
- circle e = 0
- ellipse e > 0; e < 1
- parabola e = 1
- hyperbola e > 1
- Distance from C to either Focus (F₁ or F₂)
- Approximate perimeter (p) :
p ≅ 2𝝅 √(a² + b²) / 2
If both radii are known the foci can be found.
These 2 foci are represented by the 2 blue circles at F₁ (x=170.627460668062282) and F₂ (x=329.372539331937718)
The distance between F₁ and F₂ = 79.372539331937718 x 2 = 158.745078663875436
In our ellipse
- F = √R₁² - R₂² (distance from center to focal point)
= √120 - √90
= √14400 - √8100
= √6300 = 79.372539331937718
also known as linear eccentricity
- e = √1 - b²/a² (where a=semi-major axis; b=semi-minor axis)
Circumference of ellipse
Wikipedia
Foci of an ellipse
SVG path
<path id="ell1" d="M130,250 a120,90 0 1,1 0 1 z" fill="none" stroke="gray" stroke-width="2"/>
<circle cx="250" cy="250" r="3" fill="black"/>
<circle cx="170.627460668062282" cy="250" r=3 fill="blue"/>
<circle cx="329.372539331937718" cy="250" r=3 fill="blue"/>
<text x=170.6 y=270>F₁</text>
<text x=329.3 y=270>F₂</text>