diff options
-rw-r--r-- | chickadee/math/vector.scm | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/chickadee/math/vector.scm b/chickadee/math/vector.scm index da5eef2..a617910 100644 --- a/chickadee/math/vector.scm +++ b/chickadee/math/vector.scm @@ -220,18 +220,6 @@ polar coordinate (R, THETA)." (* (vec3-y v1) (vec3-y v2)) (* (vec3-z v1) (vec3-z v2)))) -(define (vec2-normalize v) - "Return the normalized form of the vec2 V." - (with-new-vec2 new - (vec2-copy! v new) - (vec2-normalize! new))) - -(define (vec3-normalize v) - "Return the normalized form of the vec3 V." - (with-new-vec3 new - (vec3-copy! v new) - (vec3-normalize! new))) - (define-inlinable (vec2-normalize! v) "Normalize the vec2 V in-place." (unless (and (zero? (vec2-x v)) (zero? (vec2-y v))) @@ -249,6 +237,18 @@ polar coordinate (R, THETA)." (set-vec3-y! v (/ (vec3-y v) m)) (set-vec3-z! v (/ (vec3-z v) m))))) +(define (vec2-normalize v) + "Return the normalized form of the vec2 V." + (with-new-vec2 new + (vec2-copy! v new) + (vec2-normalize! new))) + +(define (vec3-normalize v) + "Return the normalized form of the vec3 V." + (with-new-vec3 new + (vec3-copy! v new) + (vec3-normalize! new))) + (define-inlinable (vec2-mult! v x) "Multiply the vec2 V by X, a real number or vec2." (if (real? x) |