# How do I use Angle?

Get help using Construct 2

### » Mon May 09, 2016 5:43 am

Hi,

According to the manual:
https://www.scirra.com/manual/126/system-expressions

"angle(x1, y1, x2, y2) Calculate angle between two points"

From that I assume 90 degrees is down, 180 degrees is left and 270 degrees is up.

So why does angle(100,100, 0, 0) return -135?

Shouldn't it be either 225 or 45? What does the negative number indicate?

Regards, John
B
17
S
5
G
2
Posts: 14
Reputation: 2,042

### » Mon May 09, 2016 6:13 am

B
80
S
48
G
30
Posts: 419
Reputation: 22,513

### » Mon May 09, 2016 11:16 am

This is the exact post by R0J0hound that explains it:

R0J0hound wrote:It's a mathimatical reason. The angle() function uses atan() to do the calculation, which has a range of [-180,180). Also that range is often referred to as a normalized angle and is usuful at times. Having the angle in the range of [0,360) is mainly useful in the case you stated above, and I usually convert it over in a expression with:
(angle(x1,y1,x2,y2)+360)%360

expression-returns-negative-angles_p1034161?#p1034161
B
131
S
45
G
41
Posts: 860
Reputation: 28,641