Calculating the angle/direction between two points from the y-axis

4nt0n's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hello people,
Let me elaborate exactly my quite cryptic title.
I have a fixed point in an lcd object and I am trying to calculate the angle a.
in the I want to have a number from 1-360 that indicates where is the nouse around the fixed point.
Using basic trigonometry I created the patch that follows. It works ok but because the sine of 0 and 180 is 0 I dont know if the mouse is in front or at the back. moreover how could I make the values going from 0 to 360?

1132.lcd.jpg
jpg
MIB's icon
Max Patch
Copy patch and select New From Clipboard in Max.

slightly modified [cartopol] helpfile:

Hope this is helpful

4nt0n's icon

hey thanx indeed that helps!
I have forgotten about the cartpol :-D

but I am still wondering how to do it without cartpol (well it is rather philological now but the urge of solving/learning :-)

MIB's icon
Max Patch
Copy patch and select New From Clipboard in Max.

the only other way of doing it I know about (and my math skills are rubbish) is this:

4nt0n's icon

well that was exactly what I was looking for!
the split object and the addition of 360...
thanx MIB

anton