diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2022-07-24 22:18:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-24 22:18:36 +0100 |
| commit | 69daac583eba3773bc3fe0947eb3340280ff8f85 (patch) | |
| tree | 5f69bf8cede22d81e3fc6294459cad15fce3bff7 | |
| parent | b28d4b753b1a3b52f90e215218e63ef9bf455bc9 (diff) | |
| parent | 00e704b216e1f20a0d6eb7a005a76a01d208caa2 (diff) | |
Merge pull request #1898 from DaseinPhaos/patch-1
fix `linalg.angle_from_quaternion`
| -rw-r--r-- | core/math/linalg/specific.odin | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/math/linalg/specific.odin b/core/math/linalg/specific.odin index a4aaeb012..c4ecb194f 100644 --- a/core/math/linalg/specific.odin +++ b/core/math/linalg/specific.odin @@ -476,21 +476,21 @@ quaternion_angle_axis :: proc{ angle_from_quaternion_f16 :: proc(q: Quaternionf16) -> f16 { if abs(q.w) > math.SQRT_THREE*0.5 { - return math.asin(q.x*q.x + q.y*q.y + q.z*q.z) * 2 + return math.asin(math.sqrt(q.x*q.x + q.y*q.y + q.z*q.z)) * 2 } return math.acos(q.w) * 2 } angle_from_quaternion_f32 :: proc(q: Quaternionf32) -> f32 { if abs(q.w) > math.SQRT_THREE*0.5 { - return math.asin(q.x*q.x + q.y*q.y + q.z*q.z) * 2 + return math.asin(math.sqrt(q.x*q.x + q.y*q.y + q.z*q.z)) * 2 } return math.acos(q.w) * 2 } angle_from_quaternion_f64 :: proc(q: Quaternionf64) -> f64 { if abs(q.w) > math.SQRT_THREE*0.5 { - return math.asin(q.x*q.x + q.y*q.y + q.z*q.z) * 2 + return math.asin(math.sqrt(q.x*q.x + q.y*q.y + q.z*q.z)) * 2 } return math.acos(q.w) * 2 |