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

Username:   Password: 
 RegisterRegister   
 Understanding Velocity.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
FeZbOy




PostPosted: Fri Jun 03, 2005 10:12 am   Post subject: Understanding Velocity.

I need help understanding velocity. There are alot of programs that use the velocity, and i need help to expand my knowledge and help me create a realistic program that uses a velocity part.

Thanks in advance.
Sponsor
Sponsor
Sponsor
sponsor
StarGateSG-1




PostPosted: Fri Jun 03, 2005 11:12 am   Post subject: (No subject)

Look in tutorial I am sure there is something about it there.
Tony




PostPosted: Sat Jun 04, 2005 1:00 pm   Post subject: (No subject)

Velocity is a vector.

a Vector is a quantaty that has a magnitude and direction. Such as force. As in the force of gravity has a magnitude of mg and a direction of vertically down.

Similary velocity has a magnitude of speed (how fast your object is moving) and a direction (which was your object is moving).
FeZbOy




PostPosted: Sat Jun 04, 2005 8:12 pm   Post subject: (No subject)

Tony wrote:
Velocity is a vector.

a Vector is a quantaty that has a magnitude and direction. Such as force. As in the force of gravity has a magnitude of mg and a direction of vertically down.

Similary velocity has a magnitude of speed (how fast your object is moving) and a direction (which was your object is moving).



Ok, i understand that. Now how do i incorparate this into a turing program?
lyam_kaskade




PostPosted: Sat Jun 04, 2005 9:16 pm   Post subject: (No subject)

Hmmm...intuition. Heh.
But seriously, just use variables to represent them.

code:

vel_x = 1
vel_y = 1

loop
x+=vel_x
y+=vel_y
drawobject  (x,y)
end loop


If you want to change the direction that the object moves in, just change the velocity. Or if you want to try something really complicated, for example, projectile motion:

code:

vel_y= xcomponent of Power of shot
vel_x= xcomponent of Power of shot
time=0

loop
time+=1
x= vel_x * time
y= vel_y *time - 9.81*time**2
drawdot (x,y)
exit when y<=0
end loop


Mess around with it. If you take physics its much easier to understand.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: