Final Project
Jonathon D.
Legislator:
David Bernsen, Senator

(Click on the image above to
enlarge.)
For my final
project, I expanded the concepts covered in the math
portion of Units 9-11. In the concluding math
assignment, shown in chapter 11 (Mission Possible), the
text described equations, such as the Vis-Visa, used to
calculate the velocities of a space shuttle needed for
interplanetary travel from Earth to Mars by means of the
Hohmann Transfer maneuver. Using the same equations, I
wrote a program using Borland C++ 5.02 that allows a
user to input any two planets for travel, and the
program calculates the departure and arrival velocities
needed. To do this I needed to research every planet's
average distance to the sun, which are displayed in the
array below initialized as "planets". I
learned to program over the last two years, however,
this project required much effort because the high level
mathematical equations needed to be implemented into the
code. As shown below, the coding for the mathematics
alone took numerous lines of code.
Also, in the
picture, I submitted a 3d image I created in LightWave
3d, a 3d program I have spent much time mastering over
the last 3 years. The main object of my final project
dealt with my personal goals of incorporating my skills
in the computer field with my interest in space science.
//NASA FINAL
PROJECT, BY JONATHAN DELGADO
#include<iostream.h>
#include<iomanip.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>
typedef array[9];
//void
Display_Distances();
void
Calculations();
void Title();
int main()
{
Calculations();
return 0;
}
void Title()
{
clrscr();
cout<<"***********************************************************************
*********";
cout<<"
Delgado's Interplanetary Departure/Arrival Velocity
Calculator"<<endl;
cout<<"***********************************************************************
*********"<<endl<<endl<<endl;
}
void
Calculations()
{
Title();
cout<<"
Welcome to my final project. I wrote a program that
allows a
NASA
engineer"<<endl;
cout<<"to
input a starting planet location, and an ending planet
location.
My
program"<<endl;
cout<<"applies
the Vis-Visa equation to calculate the velocities of the
ship
at"<<endl;
cout<<"
departure and arrival, with the preliminary condition
and
assumption
that"<<endl;
cout<<"the
interplanetary travel will utilize the Hohmann Transfer
maneuver"<<endl;
cout<<endl<<endl;
cout<<"press
any key to continue...";
getch();
array planets;
array masses;
array diameters;
planets[0] =
58;//mercury
planets[1] =
108;//venus
planets[2] =
150;//earth
planets[3] =
230;//mars
planets[4] =
778;//jupiter
planets[5] =
1427;//saturn
planets[6] =
2869;//uranus
planets[7] =
4497;//neptune
planets[8] =
5900;//pluto
int again = 2;
int p1, p2;
float v1, v2;
float a, r1, r2;
do
{
Title();
cout<<"Please
select a starting planet code number, followed by the
ending
planet"<<endl;
cout<<"code
number seperated by a space (example: earth to mars,
input: 3
4)"<<endl<<endl;
cout<<"[1]..........Mercury"<<endl;
cout<<"[2]..........Venus"<<endl;
cout<<"[3]..........Earth"<<endl;
cout<<"[4]..........Mars"<<endl;
cout<<"[5]..........Jupiter"<<endl;
cout<<"[6]..........Saturn"<<endl;
cout<<"[7]..........Uranus"<<endl;
cout<<"[8]..........Neptune"<<endl;
cout<<"[9]..........Pluto"<<endl<<endl;
cout<<"Planet
codes: ";
cin>>p1>>p2;
p1 = p1-1;
p2 = p2-1;
a =
((planets[p1]+planets[p2])/2);
r1 = planets[p1];
r2 = planets[p2];
v1 =
((1/r1)-(1/(2*a)));
v1 =
(((v1/1000)/1000)/1000);
v1 = pow(v1, .5);
v1 =
(v1*16000000);
v2 =
((1/r2)-(1/(2*a)));
v2 =
(((v2/1000)/1000)/1000);
v2 = pow(v2, .5);
v2 =
(v2*16000000);
Title();
cout<<"DEPARTURE:
"<<v1<<" MKm/sec"<<endl<<endl<<"ARRIVAL
"<<v2<<"
MKm/sec";
getch();
}while(again==2);
}
Sources:
www.nasa.gov
(info on Hohmann Transfer maneuver)
www.windows.ucar.edu
(planet distances from sun)
www.aerospacescholars.org
(idea for project)