Script Reference
Set


 arcsin (name)       //Expert

Used for : Math.

Parameters :


Description :

Calculates the arcussinus of a number. [Variabels] can be used as parameters.

This example calculates the angle 0-90° from the mouse position to a specified center point.

   setnum (CenterX ; 500)
   setnum (CenterY ; 500)

   (*1st get absolute distance from center
   by calculating with pytagoras.*)
   setnum (A ; [mouseX]-[CenterX])
   if_num (A ; < 0)
    setnum (A ; 0-[A])
   if_num (A ; < 1)
    setnum (A ; 1)
   setnum (B ; [mouseY]-[CenterY])
   if_num (B ; < 0)
    setnum (B ; 0-[B])
   if_num (B ; < 1)
    setnum (B ; 1)

   setnum (C ; [A]*[A] + [B]*[B])
   sqrt (C)
   if_num (C ; < 1)
    setnum (C ; 1)

    (*Get the angle by dividing B by C *)
    
    setnum (Angle ; [B] / [c])

   (*Getting degree vom Angle by checking a table*)
   arcsin (angle)