Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

**MathsIsFun****Administrator**- Registered: 2005-01-21
- Posts: 7,640

Made an Eccentricity Graph that shows the transition from circle, through ellipse to hyperbola.

Only problem is at e=1 which is theoretically a parabola, but comes out as rubbish (I made it a line to cover up the problem) ... any suggestions?

I want people to easily see how the conic-sections are related to e.

Code for "a" and "b":

```
if (e < 1) {
a = 1;
b = Math.sqrt(( 1-e*e)*a*a);
} else {
a = 1;
b = Math.sqrt((-1+e*e)*a*a);
}
```

Which is then plotted by this code (in a loop with "t" going from 0 to 3):

```
if (e < 1) {
xVal = a * Math.cos(t);
yVal = b * Math.sin(t);
} else if (e==1) {
xVal = t;
yVal = 0;
} else {
xVal = a / Math.cos(t);
yVal = b * Math.tan(t);
}
```

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman

Offline

**mathsyperson****Moderator**- Registered: 2005-06-22
- Posts: 4,900

Nice toy!

The one bug I can see is that when you have 1<e<<2, the hyperbola turns into vertical lines at the graph's boundary when it should just disappear.

Why did the vector cross the road?

It wanted to be normal.

Offline

**MathsIsFun****Administrator**- Registered: 2005-01-21
- Posts: 7,640

Thanks mathsy, yes I should mask that out.

Any ideas on how to illustrate the e=1 case?

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman

Offline

**MathsIsFun****Administrator**- Registered: 2005-01-21
- Posts: 7,640

A new version, and I put it on Eccentricity

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman

Offline