|
Post by rosy on Nov 2, 2021 6:42:48 GMT -6
Cheat sheet from Euclidean to RCBasic conversion.
conversion of angle in degrees (kat) to coordinates of the motion vector (x, y), v - speed:
x = cos((kat-90)/57.3)*v y = sin((kat-90)/57.3)*v
Inverse function - converts the motion vector into an direction (angle) between 0-360 degrees:
Function ang(x,y) a=atan(y/x) If x<0 then a=3.1416+a End If Return a*57.29578+90 End Function
Usually the atan2 function is used for this, but not in RC.
|
|