blob: 91484398515249bd3e428c4a41547823ad59dfe2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// Chapter 11 example 12
//------------------------------------------------------------------------------
clc;
clear;
// Given data
a = 25000*10^3; // semimajor axis in m from fig
G = 6.67*10^-11; // Gravitational constant
M = 5.98*10^24; // mass of the earth in kg
h = 0
// Calculations
u = G*M;
T = 2*%pi*sqrt((a^3)/u)
hr = T/3600 // conv. from sec to hrs and min
t = modulo(T,3600) // conv. from sec to hrs and min
mi = t/60 // conv. from sec to hrs and min
// Output
mprintf('Orbital time period = %d Hours %d minutes',hr,mi)
|