This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-01-13 10:57:41

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Trig

Can someone explain to me how to get a basic trig formula for stright movement based on direction?

Offline

 

#2 2009-01-13 12:32:14

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Trig

If you are moving in direction A and move a distance of D steps, the change in your position will be


Change in X = D * Sin(A)

Change in Y = D * Cos(A)

Note that these equations assume you are using the Scratch coordinate system where zero degrees is in the direction of the Y axis.  Many textbooks assume that the coordinate system is with zero degrees in the direction of the X axis.  If that is the case, just swap Sin for Cos and vice-versa.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2009-01-13 14:23:47

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Trig

Thanx alot! Yeah, flash works diffrently then scratch, so im glad you told me that.

Offline

 

Board footer