Computer Science Canada

Trajectory

Author:  JSBN [ Sat May 31, 2003 5:07 pm ]
Post subject:  Trajectory

This program creats trajectories. you input the Velocity and anlge, and it gives u max height and distance. I will post the source after i hand in my ISU, as it is employed in it. It also draws an arc, showing you it's path.

OK HERES THE CODE:
code:

%Variable Explanation:
%x = Velocity
%y = angle
%power = (Velocity = Vo)
%angle = angle
%v1 = Vxo
%v2 = Vyo
%t = time
%t2 = time / 2
%d = distance
%h = height

%Actual Program:

var x,y,velocity,angle,v1,v2,t,t2,d,h: real
put "Velocity:"
get velocity
x:=velocity
put "Angle:"
get angle
y:= angle
v1 :=x* cosd(y)
v2 :=x* sind(y)
t := (2* v2)/(9.8)
d:=v1 * t
t2:= v2 /9.8
h := v2*t2 - (0.5*(9.8 * (t2**2)))
put "Final distance: ",d
put "Max Height: ",h
Draw.Arc((d) div 2,0,(d) div 2,round(h),0,180,black)

Author:  JSBN [ Sun Jun 01, 2003 11:41 am ]
Post subject: 

So what do you guys think?
(w00t 200th post! 8) )

Author:  Martin [ Sun Jun 01, 2003 11:56 am ]
Post subject: 

Eek, you're catching up to me Wink

Author:  Martin [ Sun Jun 01, 2003 11:56 am ]
Post subject: 

Looks pretty cool by the way. Making anything with this?

Author:  JSBN [ Sun Jun 01, 2003 1:04 pm ]
Post subject: 

Quote:
I will post the source after i hand in my ISU, as it is employed in it.

Author:  Asok [ Sun Jun 01, 2003 2:59 pm ]
Post subject: 

you should all download JSBN's ISP when he posts it to see this subprogram in action... it's a well... u'll see. Rolling Eyes

Author:  skatelhs [ Sun Jun 01, 2003 4:25 pm ]
Post subject: 

its really good, but can i suggest putting in something like "max height: 2222 METERS or CENTIMETERS" or some kind of classification. same thing when asking for angle, and tragectory.otherwise really good!

Author:  PaddyLong [ Sun Jun 01, 2003 8:06 pm ]
Post subject: 

why woudl you do that skatelhs? it's not like it's asking for the input velocity in meters/second or whatever


I am assuming he is just using earth's gravity of 9.8m/s^2 in his calculations ... but really that value could be anything...

Author:  JSBN [ Sun Jun 01, 2003 9:39 pm ]
Post subject: 

yes, earth's gravity is employed. it's 9.8m/s^2

Author:  JSBN [ Fri Jul 04, 2003 11:09 am ]
Post subject: 

BUMP

Author:  krishon [ Fri Jul 04, 2003 11:14 am ]
Post subject: 

bump????

Author:  JSBN [ Fri Jul 04, 2003 11:18 am ]
Post subject: 

Bump.... It "bumps" the topic back to the top of the forum If i had just editied my first post, this topic, as far as i know, would still be a few pages back. So..... Yea....

Author:  krishon [ Fri Jul 04, 2003 5:14 pm ]
Post subject: 

ohhh...k sry

Author:  JSBN [ Sun Jul 06, 2003 12:13 pm ]
Post subject: 

d'o worry about it


: