OsAngleBetween
From OpenSimulator
(Difference between revisions)
(Add exemple) |
m (Add Author) |
||
Line 8: | Line 8: | ||
// | // | ||
// osAngleBetween Script Example | // osAngleBetween Script Example | ||
+ | // Author: djphil | ||
// | // | ||
Revision as of 15:26, 5 December 2020
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 |