mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-29 15:59:36 +00:00
Add regression test for vang()
This commit is contained in:
parent
9f2d9d52ef
commit
43bc09d838
2 changed files with 25 additions and 1 deletions
|
@ -42,6 +42,30 @@ module test_vabs() {
|
|||
}
|
||||
test_vabs();
|
||||
|
||||
include <BOSL2/strings.scad>
|
||||
module test_vang() {
|
||||
assert(vang([1,0])==0);
|
||||
assert(vang([0,1])==90);
|
||||
assert(vang([-1,0])==180);
|
||||
assert(vang([0,-1])==-90);
|
||||
assert(vang([1,1])==45);
|
||||
assert(vang([-1,1])==135);
|
||||
assert(vang([1,-1])==-45);
|
||||
assert(vang([-1,-1])==-135);
|
||||
assert(vang([0,0,1])==[0,90]);
|
||||
assert(vang([0,1,1])==[90,45]);
|
||||
assert(vang([0,1,-1])==[90,-45]);
|
||||
assert(vang([1,0,0])==[0,0]);
|
||||
assert(vang([0,1,0])==[90,0]);
|
||||
assert(vang([0,-1,0])==[-90,0]);
|
||||
assert(vang([-1,0,0])==[180,0]);
|
||||
assert(vang([1,0,1])==[0,45]);
|
||||
assert(vang([0,1,1])==[90,45]);
|
||||
assert(vang([0,-1,1])==[-90,45]);
|
||||
assert(approx(vang([1,1,1]),[45, 35.2643896828]));
|
||||
}
|
||||
test_vang();
|
||||
|
||||
|
||||
module test_normalize() {
|
||||
assert(normalize([10,0,0]) == [1,0,0]);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOSL_VERSION = [2,0,88];
|
||||
BOSL_VERSION = [2,0,89];
|
||||
|
||||
|
||||
// Section: BOSL Library Version Functions
|
||||
|
|
Loading…
Reference in a new issue