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

@@ -251,10 +251,10 @@ function project_plane(point, a, b, c) =
assert(is_vector(c))
assert(is_vector(point)||is_path(point))
let(
u = normalize(b-a),
v = normalize(c-a),
n = normalize(cross(u,v)),
w = normalize(cross(n,u)),
u = unit(b-a),
v = unit(c-a),
n = unit(cross(u,v)),
w = unit(cross(n,u)),
relpoint = is_vector(point)? (point-a) : translate_points(point,-a)
) relpoint * transpose([w,u]);
@@ -281,10 +281,10 @@ function lift_plane(point, a, b, c) =
assert(is_vector(c))
assert(is_vector(point)||is_path(point))
let(
u = normalize(b-a),
v = normalize(c-a),
n = normalize(cross(u,v)),
w = normalize(cross(n,u)),
u = unit(b-a),
v = unit(c-a),
n = unit(cross(u,v)),
w = unit(cross(n,u)),
remapped = point*[w,u]
) is_vector(remapped)? (a+remapped) : translate_points(remapped,a);