Advertisement

Friction on an inclined plane

Started by March 30, 2002 10:40 AM
1 comment, last by Nacho 22 years, 10 months ago
Hi! I´ve been trying to follow the derivation for friction on an inclined plane in Tricks of the Windows Game Programming Gurus, but I´m afraid that there´s a little thing I don´t understand when the author implements the algorithm in pseudocode. In the while loop there´s a sentence that saids: x_vel += y_plane*gravity*(sin(angle) - frictionk * cos(angle)); When the author explained the x and y components of the force, provided that the object is not moving, he wrote: Fy = n - m*g*cos theta = 0 Fx = n - m*g*cos theta = 0 So he said that n = m*g*cos theta Then he replaced this expression on Fx to show the critical angle and said that: Fx = m*g*sin theta - (m*g*cos theta)*frictional_coefficient and provided that Fx = m*a, dividing the Fx term by ''m'' he gets: a = g*(sin theta - frictional_coefficient*cos theta) Up to this point I agree with him, but I don´t get why did he write the sentence I wrote at the beggining: y_vel += y_plane*gravity*(sin(angle) - frictionk * cos(angle)); Does the friction of the plane affects the y axis? Thanks!
Since you are on a sloping plane, sliding along the plane would modify both your x and y velocities.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Advertisement
Ok then, yeah, I think that makes sense! Thanks a lot!

This topic is closed to new replies.

Advertisement