OsAngleBetween

From OpenSimulator

Revision as of 06:26, 3 January 2021 by Manni (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
float osAngleBetween(vector a, vector b)
returns a angle between 0 and PI
Threat Level None
Permissions Use of this function is always allowed by default
Extra Delay 0 seconds
Example(s)
//
// osAngleBetween Script Example
// Author: djphil
//
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Touch to see osAngleBetween usage.");
    }
 
    touch_start(integer number) 
    {
        vector input_a = <1.0, 2.0, 3.0>;
        vector input_b = <3.0, 2.0, 1.0>;
        float angle = osAngleBetween(input_a, input_b);
 
        llSay(PUBLIC_CHANNEL, "The angle (0.0 and PI) between " + (string)input_a + " and " + (string)input_b 
            + " is " + (string)(angle) + " in degrees and " + (string)(angle * DEG_TO_RAD) + " in radians.");
    }
}
Notes
Implemented April 4, 2018 by Ubit Umarov in GIT# e031d79d48cb4cb42ccb160d2894d078f835eb10 - Commit e031d7
Personal tools
General
About This Wiki