Math.atan2 only works around (0,0)?

The following code will always print 45* because math.atan2 works around the coordinates (0,0)

local x, y = 20,20
print(math.deg(math.atan(y,x)))

but what if I wanted math.atan2 to work around the coordinate points (40,40)? so whenever I execute the same code, it’ll print 135*?

local x, y = 20, 20
local originX, originY = 40, 40
local newX, newY = x - originX, y - originY
print(math.deg(math.atan(y,x)))
2 Likes

lol, didnt think it was gonna be that simple. Thank you.