- #1
fmucker
- 7
- 0
Homework Statement
I need to know how to apply the coefficent of friction and gravity to a 3-coordinate (3D) velocity vector.
For my Intro to C Programming class, our final project is to write a program that simulates the trajectory of an asteroid passing a gas giant. The problem is, I haven't taken college Physics and this goes way, way beyond high school physics. I also have a limited understanding of Calculus (just barely passing Calc 1 right now). Here is the assignment:
Thanks in advance for the help. I think I am being clear enough, but I have been studying for finals all day and my brain is almost fried. Please let me know if I need to specify things further.Create a program that simulates the trajectory of an asteroid passing by a gas giant.
Below are parameters needed for the simulation. The units for time and distance have been chosen to simplify some of the parameters. Assume the asteroid mass is negligible.
Gravity = 1.0 (gravitational acceleration when at distance 1.0)
Atmospheric radius = 1.0 (distance from planet centroid to end of atmosphere)
Coefficient of friction = 100.0 (acceleration per time per speed while within atmosphere)
Distance (initial) from planet centroid in range [1.0, 10.0] input by user
Speed (initial) of asteroid in range [0.0, 10.0] input by user
Angle of approach in radians in range [0.0, 1.0] input by user (0 means aimed at planet)
Simulate the trajectory of the asteroid, starting at time 0.0, and with the position and velocity as specified by user input. Note that the user does not need to specify the asteroid initial position using 3 coordinates. The user is only asked for the relevant information. For your Cartesian coordinates, let the centroid of the gas giant be fixed at coordinate (0.0, 0.0, 0.0) and let the initial location of the asteroid be (Distance (initial), 0.0, 0.0). Set the third coordinate of the initial velocity vector to 0.0, and set its other coordinates to be non-negative.
Use the simplest model of friction. The asteroid is either within the atmosphere or outside it. If the asteroid is within the atmosphere, then it is subject to a constant coefficient of friction, regardless of its precise location.
(cut the rest off for space)