From 860899cd6df7a477af1a7a4c86c3ac5baaa7d06a Mon Sep 17 00:00:00 2001 From: Alexander Ekdahl Date: Mon, 19 Jun 2023 15:20:01 +0200 Subject: [PATCH] Remove unnecessary normalization in `Rotation3::face_towards` `zaxis` and `xaxis` are already normalized which means `zaxis.cross(&xaxis)` should already be normalized. --- src/geometry/rotation_specialization.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/geometry/rotation_specialization.rs b/src/geometry/rotation_specialization.rs index 1ea5cd92..17001d1a 100644 --- a/src/geometry/rotation_specialization.rs +++ b/src/geometry/rotation_specialization.rs @@ -478,9 +478,10 @@ where SB: Storage, SC: Storage, { + // Gram–Schmidt process let zaxis = dir.normalize(); let xaxis = up.cross(&zaxis).normalize(); - let yaxis = zaxis.cross(&xaxis).normalize(); + let yaxis = zaxis.cross(&xaxis); Self::from_matrix_unchecked(SMatrix::::new( xaxis.x.clone(),