# Quick question

## Recommended Posts

Hello, i got a quick question, if i want to go from a point to the north, whats the sum/rest of X,Y that im getting?

eg: going to the north by 1 point would represent an increase of X of 1 point. (0.5 if X/Y were made on 45° angles)

PD: I'm trying to get a rotation by X,Y Points as in my script the getElementRotation seems to not work.

Can you clarify your question? Tell us what you're trying to do or give an example...

• Moderators
```function findRotation(x1,y1,x2,y2)

local t = -math.deg(math.atan2(x2-x1,y2-y1))
if t < 0 then t = t + 360 end;
return t;

end

rot = findRotation(x,y, x + 0.5 ,y )
```

https://wiki.multitheftauto.com/wiki/FindRotation

```function findRotation(x1,y1,x2,y2)

local t = -math.deg(math.atan2(x2-x1,y2-y1))
if t < 0 then t = t + 360 end;
return t;

end

rot = findRotation(x,y, x + 0.5 ,y )
```

https://wiki.multitheftauto.com/wiki/FindRotation

Yeah, got it, thanks thought ## Create an account

Register a new account