Repository: bitshifter/glam-rs
Pull request #469 (2024-02-08 15:05:07)

Fix typos.


Patch:
diff --git a/codegen/templates/mat.rs.tera b/codegen/templates/mat.rs.tera
index 0272f39..efe8ba9 100644
--- a/codegen/templates/mat.rs.tera
+++ b/codegen/templates/mat.rs.tera
@@ -1798,7 +1798,7 @@ impl {{ self_t }} {
     /// `1.0`.
     ///
     /// This method assumes that `self` contains a valid affine transform. It does not perform
-    /// a persective divide, if `self` contains a perspective transform, or if you are unsure,
+    /// a perspective divide, if `self` contains a perspective transform, or if you are unsure,
     /// the [`Self::project_point3()`] method should be used instead.
     ///
     /// # Panics
diff --git a/codegen/templates/quat.rs.tera b/codegen/templates/quat.rs.tera
index 03d8598..78db7d9 100644
--- a/codegen/templates/quat.rs.tera
+++ b/codegen/templates/quat.rs.tera
@@ -398,10 +398,10 @@ impl {{ self_t }} {
         const ONE_MINUS_EPS: {{ scalar_t }} = 1.0 - 2.0 * core::{{ scalar_t }}::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPS {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPS {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             use core::{{ scalar_t }}::consts::PI; // half a turn = 𝛕/2 = 180°
             Self::from_axis_angle(from.any_orthonormal_vector(), PI)
         } else {
@@ -454,10 +454,10 @@ impl {{ self_t }} {
         const ONE_MINUS_EPSILON: {{ scalar_t }} = 1.0 - 2.0 * core::{{ scalar_t }}::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPSILON {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPSILON {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             const COS_FRAC_PI_2: {{ scalar_t }} = 0.0;
             const SIN_FRAC_PI_2: {{ scalar_t }} = 1.0;
             // rotation around z by PI radians
diff --git a/src/f32/coresimd/mat4.rs b/src/f32/coresimd/mat4.rs
index b430fcd..1117c12 100644
--- a/src/f32/coresimd/mat4.rs
+++ b/src/f32/coresimd/mat4.rs
@@ -1078,7 +1078,7 @@ impl Mat4 {
     /// `1.0`.
     ///
     /// This method assumes that `self` contains a valid affine transform. It does not perform
-    /// a persective divide, if `self` contains a perspective transform, or if you are unsure,
+    /// a perspective divide, if `self` contains a perspective transform, or if you are unsure,
     /// the [`Self::project_point3()`] method should be used instead.
     ///
     /// # Panics
diff --git a/src/f32/coresimd/quat.rs b/src/f32/coresimd/quat.rs
index 0d6d1af..0e4e703 100644
--- a/src/f32/coresimd/quat.rs
+++ b/src/f32/coresimd/quat.rs
@@ -285,10 +285,10 @@ impl Quat {
         const ONE_MINUS_EPS: f32 = 1.0 - 2.0 * core::f32::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPS {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPS {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             use core::f32::consts::PI; // half a turn = 𝛕/2 = 180°
             Self::from_axis_angle(from.any_orthonormal_vector(), PI)
         } else {
@@ -341,10 +341,10 @@ impl Quat {
         const ONE_MINUS_EPSILON: f32 = 1.0 - 2.0 * core::f32::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPSILON {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPSILON {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             const COS_FRAC_PI_2: f32 = 0.0;
             const SIN_FRAC_PI_2: f32 = 1.0;
             // rotation around z by PI radians
diff --git a/src/f32/scalar/mat4.rs b/src/f32/scalar/mat4.rs
index 9b1d115..5affa5a 100644
--- a/src/f32/scalar/mat4.rs
+++ b/src/f32/scalar/mat4.rs
@@ -999,7 +999,7 @@ impl Mat4 {
     /// `1.0`.
     ///
     /// This method assumes that `self` contains a valid affine transform. It does not perform
-    /// a persective divide, if `self` contains a perspective transform, or if you are unsure,
+    /// a perspective divide, if `self` contains a perspective transform, or if you are unsure,
     /// the [`Self::project_point3()`] method should be used instead.
     ///
     /// # Panics
diff --git a/src/f32/scalar/quat.rs b/src/f32/scalar/quat.rs
index d30e4a6..04009bc 100644
--- a/src/f32/scalar/quat.rs
+++ b/src/f32/scalar/quat.rs
@@ -293,10 +293,10 @@ impl Quat {
         const ONE_MINUS_EPS: f32 = 1.0 - 2.0 * core::f32::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPS {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPS {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             use core::f32::consts::PI; // half a turn = 𝛕/2 = 180°
             Self::from_axis_angle(from.any_orthonormal_vector(), PI)
         } else {
@@ -349,10 +349,10 @@ impl Quat {
         const ONE_MINUS_EPSILON: f32 = 1.0 - 2.0 * core::f32::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPSILON {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPSILON {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             const COS_FRAC_PI_2: f32 = 0.0;
             const SIN_FRAC_PI_2: f32 = 1.0;
             // rotation around z by PI radians
diff --git a/src/f32/sse2/mat4.rs b/src/f32/sse2/mat4.rs
index 490b981..22d42fb 100644
--- a/src/f32/sse2/mat4.rs
+++ b/src/f32/sse2/mat4.rs
@@ -1087,7 +1087,7 @@ impl Mat4 {
     /// `1.0`.
     ///
     /// This method assumes that `self` contains a valid affine transform. It does not perform
-    /// a persective divide, if `self` contains a perspective transform, or if you are unsure,
+    /// a perspective divide, if `self` contains a perspective transform, or if you are unsure,
     /// the [`Self::project_point3()`] method should be used instead.
     ///
     /// # Panics
diff --git a/src/f32/sse2/quat.rs b/src/f32/sse2/quat.rs
index ce032fe..2474577 100644
--- a/src/f32/sse2/quat.rs
+++ b/src/f32/sse2/quat.rs
@@ -293,10 +293,10 @@ impl Quat {
         const ONE_MINUS_EPS: f32 = 1.0 - 2.0 * core::f32::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPS {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPS {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             use core::f32::consts::PI; // half a turn = 𝛕/2 = 180°
             Self::from_axis_angle(from.any_orthonormal_vector(), PI)
         } else {
@@ -349,10 +349,10 @@ impl Quat {
         const ONE_MINUS_EPSILON: f32 = 1.0 - 2.0 * core::f32::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPSILON {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPSILON {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             const COS_FRAC_PI_2: f32 = 0.0;
             const SIN_FRAC_PI_2: f32 = 1.0;
             // rotation around z by PI radians
diff --git a/src/f32/wasm32/mat4.rs b/src/f32/wasm32/mat4.rs
index 22b67a7..156e1de 100644
--- a/src/f32/wasm32/mat4.rs
+++ b/src/f32/wasm32/mat4.rs
@@ -1078,7 +1078,7 @@ impl Mat4 {
     /// `1.0`.
     ///
     /// This method assumes that `self` contains a valid affine transform. It does not perform
-    /// a persective divide, if `self` contains a perspective transform, or if you are unsure,
+    /// a perspective divide, if `self` contains a perspective transform, or if you are unsure,
     /// the [`Self::project_point3()`] method should be used instead.
     ///
     /// # Panics
diff --git a/src/f32/wasm32/quat.rs b/src/f32/wasm32/quat.rs
index 7247b27..c9dc2f8 100644
--- a/src/f32/wasm32/quat.rs
+++ b/src/f32/wasm32/quat.rs
@@ -285,10 +285,10 @@ impl Quat {
         const ONE_MINUS_EPS: f32 = 1.0 - 2.0 * core::f32::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPS {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPS {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             use core::f32::consts::PI; // half a turn = 𝛕/2 = 180°
             Self::from_axis_angle(from.any_orthonormal_vector(), PI)
         } else {
@@ -341,10 +341,10 @@ impl Quat {
         const ONE_MINUS_EPSILON: f32 = 1.0 - 2.0 * core::f32::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPSILON {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPSILON {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             const COS_FRAC_PI_2: f32 = 0.0;
             const SIN_FRAC_PI_2: f32 = 1.0;
             // rotation around z by PI radians
diff --git a/src/f64/dmat4.rs b/src/f64/dmat4.rs
index cc9147c..e9012fe 100644
--- a/src/f64/dmat4.rs
+++ b/src/f64/dmat4.rs
@@ -981,7 +981,7 @@ impl DMat4 {
     /// `1.0`.
     ///
     /// This method assumes that `self` contains a valid affine transform. It does not perform
-    /// a persective divide, if `self` contains a perspective transform, or if you are unsure,
+    /// a perspective divide, if `self` contains a perspective transform, or if you are unsure,
     /// the [`Self::project_point3()`] method should be used instead.
     ///
     /// # Panics
diff --git a/src/f64/dquat.rs b/src/f64/dquat.rs
index eddcfa1..946721b 100644
--- a/src/f64/dquat.rs
+++ b/src/f64/dquat.rs
@@ -282,10 +282,10 @@ impl DQuat {
         const ONE_MINUS_EPS: f64 = 1.0 - 2.0 * core::f64::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPS {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPS {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             use core::f64::consts::PI; // half a turn = 𝛕/2 = 180°
             Self::from_axis_angle(from.any_orthonormal_vector(), PI)
         } else {
@@ -338,10 +338,10 @@ impl DQuat {
         const ONE_MINUS_EPSILON: f64 = 1.0 - 2.0 * core::f64::EPSILON;
         let dot = from.dot(to);
         if dot > ONE_MINUS_EPSILON {
-            // 0° singulary: from ≈ to
+            // 0° singularity: from ≈ to
             Self::IDENTITY
         } else if dot < -ONE_MINUS_EPSILON {
-            // 180° singulary: from ≈ -to
+            // 180° singularity: from ≈ -to
             const COS_FRAC_PI_2: f64 = 0.0;
             const SIN_FRAC_PI_2: f64 = 1.0;
             // rotation around z by PI radians


Test patch:
diff --git a/tests/euler.rs b/tests/euler.rs
index b2d0726..923a35d 100644
--- a/tests/euler.rs
+++ b/tests/euler.rs
@@ -5,7 +5,7 @@ mod support;
 /// * `q`, if q.w > epsilon
 /// * `-q`, if q.w < -epsilon
 /// * `(0, 0, 0, 1)` otherwise
-/// The rationale is that q and -q represent the same rotation, and any (_, _, _, 0) respresent no rotation at all.
+/// The rationale is that q and -q represent the same rotation, and any (_, _, _, 0) represent no rotation at all.
 trait CanonicalQuat: Copy {
     fn canonical(self) -> Self;
 }
diff --git a/tests/support/macros.rs b/tests/support/macros.rs
index e7fadd1..52f7a64 100644
--- a/tests/support/macros.rs
+++ b/tests/support/macros.rs
@@ -185,7 +185,7 @@ macro_rules! vec3_float_test_vectors {
             $vec3::new(0.2, 0.3, 0.4),
             $vec3::new(4.0, -5.0, 6.0),
             $vec3::new(-2.0, 0.5, -1.0),
-            // Pathalogical cases from <https://graphics.pixar.com/library/OrthonormalB/paper.pdf>:
+            // Pathological cases from <https://graphics.pixar.com/library/OrthonormalB/paper.pdf>:
             $vec3::new(0.00038527316, 0.00038460016, -0.99999988079),
             $vec3::new(-0.00019813581, -0.00008946839, -0.99999988079),
         ]
@@ -212,7 +212,7 @@ macro_rules! vec2_float_test_vectors {
             $vec2::new(0.2, 0.3),
             $vec2::new(4.0, -5.0),
             $vec2::new(-2.0, 0.5),
-            // Pathalogical cases from <https://graphics.pixar.com/library/OrthonormalB/paper.pdf>:
+            // Pathological cases from <https://graphics.pixar.com/library/OrthonormalB/paper.pdf>:
             $vec2::new(0.00038527316, 0.00038460016),
             $vec2::new(-0.00019813581, -0.00008946839),
         ]