How to get coordinates of point to the right of vehicle?
#10

On the unit circle



To get to the correct x we need cos and for y we need sin
Код:
x = cos(angle)
y = sin(angle)
The only thing we need to consider in sa-mp is that 0 degrees is 90 degrees in the unit circle, also we use
Код:
x = cos(angle + 90)
y = sin(angle + 90)
Another notation for that would be
Код:
x = -sin(angle)
y = cos(angle)
In the end we just add these cordinates to our original position
Код:
x = x - sin(angle)
y = y + cos(angle)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 6 Guest(s)