Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualmrjones

Posted 16 May 2012 - 04:36 AM

I think you might want this equation, if sp is just distance, not a vector. Moving at angle 0 means moving on x-axis in this equation:

x2 = x1 + cos(angle) * sp
y2 = y1 + sin(angle) * sp

For example moving from (0, 0) at an angle 0 to distance 5 would give the following result:
x2 = 0 + 1 * 5 = 5
y2 = 0 + 0 * 5 = 0

#1mrjones

Posted 16 May 2012 - 04:36 AM

I think you might want this equation instead, if sp is just distance, not a vector. Moving at angle 0 means moving on x-axis in this equation:

x2 = x1 + cos(angle) * sp
y2 = y1 + sin(angle) * sp

For example moving from (0, 0) at an angle 0 to distance 5 would give the following result:
x2 = 0 + 1 * 5 = 5
y2 = 0 + 0 * 5 = 0

PARTNERS