Math Is Fun Forum

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

You are not logged in.

#1 2009-04-29 21:25:28

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,713

Eccentricity and Conic Sections

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

#2 2009-04-29 23:17:45

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

Re: Eccentricity and Conic Sections

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

#3 2009-04-30 10:19:50

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,713

Re: Eccentricity and Conic Sections

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

#4 2009-05-07 22:54:49

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,713

Re: Eccentricity and Conic Sections

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

Board footer

Powered by FluxBB