I think the atan2 block is messed up

JS will work in radians (as most languages do) - Snap! works in degrees

oh.

In addition to reporting a value in degrees rather than radians, Snap’s atan2 reporter uses Snap’s coordinate system and Snap’s angles, which are reversed to the ones you usually use in other systems (Snap’s angles increase clockwise). Therefore in Snap the atan2 block takes (x,y) coordinate values - instead of (y, x) as in other systems. This actually makes it much easier to use, if you think about it: You can think of atan2 as the angle from the stage’s center to the given x/y coordinates.

I would have loved to not call it atan2, but suggested to call the reporter (“angle from center to x: y: “) instead, but Brian was adamant that it has to be named “atan2”…

well that just makes it more confusing :expressionless:

atan2 - you love it or you hate it.

This should be its name. I didn’t know what it did until I read this

Or maybe at least in the help screen

Yeah, I can think of three recent projects that this block could've helped a ton in had I known what it did

yes, I understand. The idea is really that you use atan2 to figure out the angle between 2 points, by taking the atan2 of the second point minus the first one.

I made that block after reading this topic:
atan2 (almost)

yes, that’s exactly how to use it. You can then build a fun mouse-chaser with your custom block:

Of course atan2 is really only useful if you want the direction from a point that the sprite is not at, since you can just use ([direction V] to [mouse-pointer V])

yes, absolutely, the purpose of atan2 is to determine the angle between 2 arbitrary points.