Renamed normalize() to unit()

This commit is contained in:
Revar Desmera
2020-03-02 19:30:20 -08:00
parent af0e285781
commit 07bfcd6a57
21 changed files with 109 additions and 109 deletions

View File

@@ -67,17 +67,17 @@ module test_vang() {
test_vang();
module test_normalize() {
assert(normalize([10,0,0]) == [1,0,0]);
assert(normalize([0,10,0]) == [0,1,0]);
assert(normalize([0,0,10]) == [0,0,1]);
assert(abs(norm(normalize([10,10,10]))-1) < EPSILON);
assert(abs(norm(normalize([-10,-10,-10]))-1) < EPSILON);
assert(abs(norm(normalize([-10,0,0]))-1) < EPSILON);
assert(abs(norm(normalize([0,-10,0]))-1) < EPSILON);
assert(abs(norm(normalize([0,0,-10]))-1) < EPSILON);
module test_unit() {
assert(unit([10,0,0]) == [1,0,0]);
assert(unit([0,10,0]) == [0,1,0]);
assert(unit([0,0,10]) == [0,0,1]);
assert(abs(norm(unit([10,10,10]))-1) < EPSILON);
assert(abs(norm(unit([-10,-10,-10]))-1) < EPSILON);
assert(abs(norm(unit([-10,0,0]))-1) < EPSILON);
assert(abs(norm(unit([0,-10,0]))-1) < EPSILON);
assert(abs(norm(unit([0,0,-10]))-1) < EPSILON);
}
test_normalize();
test_unit();
module test_vector_angle() {