mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-21 22:05:20 +00:00
@@ -275,7 +275,8 @@ to_ptr :: proc{vector_to_ptr, matrix_to_ptr}
|
||||
vector_angle_between :: proc "contextless" (a, b: $V/[$N]$E) -> E {
|
||||
a0 := normalize0(a)
|
||||
b0 := normalize0(b)
|
||||
return math.acos(dot(a0, b0))
|
||||
d := clamp(dot(a0, b0), -1, +1)
|
||||
return math.acos(d)
|
||||
}
|
||||
quaternion64_angle_between :: proc "contextless" (a, b: $Q/quaternion64) -> f16 {
|
||||
c := normalize0(conj(a) * b)
|
||||
|
||||
Reference in New Issue
Block a user