Here is the function for getting the angle from the two points:
//
// Retrieve the degrees of two points, presumably from the screen origin of (0, 0).
//
function getDegreesFromXY( sX, sY, eX, eY )
// Utilise the atanfull() to get the angle between the two points
dX# = abs( eX - sX )
dY# = abs( eY - sY )
deg# = atanfull( dX#, dY# )
REMSTART
// The following gives the same results as the command above (dX and dY have been swapped around)
deg# = atanfull( dY#, dX# ) - 90.0
deg# = checkDegs( CIRCLE_DEGREES - deg# )
REMEND
endfunction deg#
It is utilised to get the angle of the sprite from the centre of the screen:
deg = getDegreesFromXY( calcPos.originX, calcPos.originY, x, y )
It gives the following log:
Ball x:406 y:63 deg:1 atan deg:1
Ball x:410 y:72 deg:2 atan deg:2
Ball x:413 y:80 deg:3 atan deg:3
.
.
.
Ball x:491 y:272 deg:73 atan deg:72
Ball x:494 y:280 deg:78 atan deg:77
Ball x:497 y:288 deg:90 atan deg:82
Ball x:501 y:297 deg:90 atan deg:88
Ball x:504 y:305 deg:90 atan deg:87
Ball x:507 y:314 deg:90 atan deg:82
Ball x:511 y:322 deg:79 atan deg:78
Ball x:514 y:330 deg:76 atan deg:75
.
.
.
Ball x:571 y:472 deg:44 atan deg:44
Ball x:575 y:480 deg:44 atan deg:44
Ball x:578 y:489 deg:43 atan deg:43
The deg:n values are from an acos() comparative calculation.
Given the above, why is the atanfull() decreasing after reaching the value of 90?
Thanks again,