Showing posts with label eccentricity. Show all posts
Showing posts with label eccentricity. Show all posts

Monday, December 11, 2017

HP Prime: Perigee and Apogee of a Conic Section

HP Prime:  Perigee and Apogee of a Conic Section

Introduction

The program CONICAP determines three characteristics of a conic section:

Eccentricity:
E = 0, circle
0 < E < 1, ellipse
E = 1, parabola (this case is not covered)
E > 1, hyperbola

Periapsis (Perigee):
The point on the conic section where it is closest to a primary focus (which is designated at one of the two foci F or F’).

Apoapsis (Apogee):
The point on the conic section where it is furthest away from a primary focus.  Note for a hyperbola and a parabola, the apogee is ∞. 

 The inputs are the lengths of the semi-major axis (A) and the semi-minor axis (P).  For a hyperbola, input A as negative. 



HP Prime Program CONICAP

EXPORT CONICAP(A,P)
BEGIN
// EWS 2017-12-10
// Fundamentals Of Astrodynamics
// ABS(A)≥P
LOCAL E;
E:=√(1-P/A);
PRINT();
PRINT("Perigee: "+STRING(A*(1-E)));
IF A≥0 THEN
PRINT("Apogee: "+STRING(A*(1+E)));
END;
PRINT("Eccentricity: "+E);
IF E==0 THEN
PRINT("Circle");
END;
IF E>0 AND E<1 THEN
PRINT("Ellipse");
END;
IF E>1 THEN
PRINT("Hyperbola");
END;
END;

Examples


A = 8, P = 3
A = 5, P = 5
A = -8, P = 3
Perigee
1.67544467966
5
1.38083151968
Apogee
14.3245553203
5
N/A
Eccentricity
0.790569415042
0
1.17260393996

Source:
Roger R. Bate, Donald D. Mueller, Jerry E. White.  Fundamentals of Astrodynamics Dover Publications: New York.  1971. ISBN-13: 978-0-486-60061-1

Eddie


This blog is property of Edward Shore, 2017.

Sunday, July 31, 2016

Casio fx-50FH Programs: Ellipses

Casio fx-50FH Programs: Ellipses

Hello everyone!  It is good to be back.  What a crazy year this has been so far.  





Introduction

The programs assume that the center of the ellipse is (0,0).  They can be adopted on the current Casio graphing calculators and fx-5800p as well (some adjustments may be necessary).  

Casio fx-50FH Ellipse Program 1: Area, Eccentricity, Focal Points
(61 steps)

Text after double slash marks (\\) are comments.  

?→X:   \\ radius on X-axis
?→Y:   \\ radius on Y-axis
X≥Y ⇒ Goto 0:
X→B: Y→A: Goto 1:  \\ X ≥ Y 
Lbl 0: X→A: Y→B:   \\ X < Y
Lbl 1: πAB ◢  \\ calculate area
√(1 - B ² ÷ A ²) ◢   \\ calculate eccentricity 
√(A ² - B ²)  \\ focal distance 

Test 1: X = 6.63, Y = 1.86
Area:  38.74149229
Eccentricity: 0.959841462
Focal Distance: 6.36748895
Hence the focal points are (-6.36748895, 0) and (6.36748895, 0)

Test 2: X = 2.99, Y = 5.06
Area: 47.53041189
Eccentricity: 0.806738152
Focal Distance: 4.08209505
Hence the focal points are (0, -4.08209505) and (0, 4.08209505)

Casio fx-50FH Ellipse Program 2: Points on the Ellipse, and distance to center (0,0)
(54 steps)

You specify A, B, and D.  D represents the number of steps.  Degree mode is set. 

?→A: ?→B: ?→D:
Deg: For 0→M To 360 Step 360 ÷ D:  \\ set up loop
M ◢  \\ display angle 
A cos(M) → X ◢   \\ display X coordinate 
B sin(M) → Y ◢  \\ display Y coordinate
√( X ² + Y ² ) ◢  \\ distance to center
Next  \\ end loop

Test: A = 3.25, B = 2.75, D = 6
Results: (angle, X, Y, distance)
0.000, 3.250, 0.000, 3.250
60.000, 1.625, 2.382, 2.883
120.000, -1.625, 2.382, 2.883
180.000, -3.250, 0.000, 3.250
240.000, -1.625, -2.382, 2.883
300.000, 1.625, -2.382, 2.883
360.000, 3.250, 0.000, 3.250

Until next time, 

Eddie


This blog is property of Edward Shore, 2016

Saturday, August 4, 2012

Applications and Programming: Ellipses

The following program works with several properties with ellipses. The general equation for an ellipse with center (x0, y0) is:

(x - x0)^2 / a^2 + (y -y0)^2 / b^2 = 1

For today's blog, I will center the ellipse at the origin (0,0).


With a and b as the length of the semi-axes:

* min(a,b) is the length of the semi-minor axis. min is the Minimum function, the least of a and b.
* max(a,b) is the length of the semi-major axis. max is the Maximum function, the greater of a and b.
* The eccentricity of the ellipse is e = √ (1 - [min(a,b) / max(a,b)]^2). In this sense, e is not the constant 2.7182818285... . If e = 0, then the ellipse is actually a circle. Further more, you can determine where the foci are, which is the distance e * max(a,b) along the semi-major axis.
* The area of an ellipse is easy enough: A = π a b
* The circumference is a different story. A good estimate, suggest by the NCEES, if a and b are close together is C ≈ 2 π √ ( [a^2 - b^2] / 2)

Finding the true circumference will require some calculus. Let the ellipse be defined by the parametric equations:

x(t) = a cos t
y(t) = b sin t
With 0 ≤ t ≤ 2 π

The arc length of a parametric equation is

∫ ( √ ( (dx/dt)^2 + (dy/dt)^2 ) dt, t0, t1)

Which means that the true circumference of an ellipse is

∫ ( √ ( a^2 sin(t)^2 + b^2 cos(t)^2 ) dt, 0, 2 π )

Any calculator with integration can handle this.

The ELLIPSE Program, TI-84+, 184 bytes

The following program will:
1. Prompt for a and b. (A, B)
2. Calculate eccentricity (E).
3. Calculate area (A).
4. Calculate circumference (C).
5. Draw the ellipse. The program leaves the user on the graph screen. The ellipse can be traced and used for further analysis if desired.


ELLIPSE - TI-84+

: Param
: Radian
: Disp "X^2/A^2+Y^2/B^2 =1"
: Prompt A,B
: "A cos(T)"→X1T
: "B sin(T)" →Y1T
: FnOff
: PlotsOff
: FnOn 1
: 0 →Tmin
: 2 π →Tmax
: π / 128 →Tstep
: √(1-(min(A,B)/max(A,B))² → E
: π A B → R
: fnInt(√(A² sin(T)² + B² cos(T)² , T, 0, 2 π) → C
: Disp "ECC.=", E
: Pause
: Disp "AREA=", R
: Pause
: Disp "CIRC.=",C
: Pause
: ZoomFit


Here is the ELLIPSE program executed with A=2 and B=3:

I thank you once again. Thank you to the followers of my blog, love the comments, I appreciate it.

Until next time,

Eddie


This blog is property of Edward Shore. © 2012

Python in Numworks: Duplicating and Grayscale

Python in Numworks: Duplicating and Grayscale All three scripts presented today use the math, random, and the Numworks specific ...