aboutsummaryrefslogtreecommitdiff
path: root/core/math/linalg/specific.odin
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-04-26 11:45:46 +0100
committergingerBill <bill@gingerbill.org>2022-04-26 11:45:46 +0100
commitc81fd2e5dd82fba0d5a1eb6771b1816cdb4ba574 (patch)
treec5907b39499a8ec49d62f82b0a74bace79ccc27a /core/math/linalg/specific.odin
parent3bd71229596427d43551ff6612d71505bb79c796 (diff)
Fix #1644
Diffstat (limited to 'core/math/linalg/specific.odin')
-rw-r--r--core/math/linalg/specific.odin6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/math/linalg/specific.odin b/core/math/linalg/specific.odin
index cb007bd91..a4aaeb012 100644
--- a/core/math/linalg/specific.odin
+++ b/core/math/linalg/specific.odin
@@ -479,21 +479,21 @@ angle_from_quaternion_f16 :: proc(q: Quaternionf16) -> f16 {
return math.asin(q.x*q.x + q.y*q.y + q.z*q.z) * 2
}
- return math.cos(q.x) * 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.cos(q.x) * 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.cos(q.x) * 2
+ return math.acos(q.w) * 2
}
angle_from_quaternion :: proc{
angle_from_quaternion_f16,