Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Trajectory
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
JSBN




PostPosted: 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)



trajectory.zip
 Description:
This is it!

Download
 Filename:  trajectory.zip
 Filesize:  267.56 KB
 Downloaded:  303 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
JSBN




PostPosted: Sun Jun 01, 2003 11:41 am   Post subject: (No subject)

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




PostPosted: Sun Jun 01, 2003 11:56 am   Post subject: (No subject)

Eek, you're catching up to me Wink
Martin




PostPosted: Sun Jun 01, 2003 11:56 am   Post subject: (No subject)

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




PostPosted: Sun Jun 01, 2003 1:04 pm   Post subject: (No subject)

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




PostPosted: Sun Jun 01, 2003 2:59 pm   Post subject: (No 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
skatelhs




PostPosted: Sun Jun 01, 2003 4:25 pm   Post subject: (No 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!
PaddyLong




PostPosted: Sun Jun 01, 2003 8:06 pm   Post subject: (No 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...
JSBN




PostPosted: Sun Jun 01, 2003 9:39 pm   Post subject: (No subject)

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




PostPosted: Fri Jul 04, 2003 11:09 am   Post subject: (No subject)

BUMP
krishon




PostPosted: Fri Jul 04, 2003 11:14 am   Post subject: (No subject)

bump????
JSBN




PostPosted: Fri Jul 04, 2003 11:18 am   Post subject: (No 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....
krishon




PostPosted: Fri Jul 04, 2003 5:14 pm   Post subject: (No subject)

ohhh...k sry
JSBN




PostPosted: Sun Jul 06, 2003 12:13 pm   Post subject: (No subject)

d'o worry about it
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 14 Posts ]
Jump to:   


Style:  
Search: