summaryrefslogtreecommitdiff
path: root/2219/CH11/EX11.15/Ex11_15.sce
blob: 90ee015f87cd8afdfef5c04abe17d4fa36d9a261 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Chapter 11 example 15
//------------------------------------------------------------------------------
clc;
clear;
// Given data
a       = 20000;            // semi major axis of elliptical sate. orbit in kms
b       = 16000;            // semi minor axis of elliptical sate. orbit in kms

// calculations
// a = (ra + rp)/2
// b = sqrt(ra*rp)
// let k = (ra + rp)
// let l = ra*rp
k       = 2*a;              // ra+ rp ----------------1
l       = b^2;              // ra*rp -----------------2
// ra^2 -40000ra + 256000000
p       = [ 1 -k l]
x       = roots(p)
r1      = x(1)
r2      = x(2)
rp = k - r1;
mprintf('Apogee distance = %d km\n Perigee distance = %d km',r1,rp);
//------------------------------------------------------------------------------