mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 00:09:41 +00:00
Corrected modang() example.
This commit is contained in:
parent
3284950b3b
commit
f3c70d3741
1 changed files with 6 additions and 6 deletions
12
math.scad
12
math.scad
|
@ -602,12 +602,12 @@ function posmod(x,m) =
|
|||
// Description:
|
||||
// Takes an angle in degrees and normalizes it to an equivalent angle value between -180 and 180.
|
||||
// Example:
|
||||
// a1 = modang(-700,360); // Returns: 20
|
||||
// a2 = modang(-270,360); // Returns: 90
|
||||
// a3 = modang(-120,360); // Returns: -120
|
||||
// a4 = modang(120,360); // Returns: 120
|
||||
// a5 = modang(270,360); // Returns: -90
|
||||
// a6 = modang(700,360); // Returns: -20
|
||||
// a1 = modang(-700); // Returns: 20
|
||||
// a2 = modang(-270); // Returns: 90
|
||||
// a3 = modang(-120); // Returns: -120
|
||||
// a4 = modang(120); // Returns: 120
|
||||
// a5 = modang(270); // Returns: -90
|
||||
// a6 = modang(700); // Returns: -20
|
||||
function modang(x) =
|
||||
assert( is_finite(x), "Input must be a finite number.")
|
||||
let(xx = posmod(x,360)) xx<180? xx : xx-360;
|
||||
|
|
Loading…
Reference in a new issue