Skip to content

Commit

Permalink
remove vecnorm(q::UnitQuaternion) function
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrodium committed Oct 31, 2021
1 parent 934cf9b commit 09e0313
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/unitquaternion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,6 @@ end
# Inverses
inv(q::Q) where Q <: UnitQuaternion = Q(q.w, -q.x, -q.y, -q.z, false)

# Norms
vecnorm(q::UnitQuaternion) = sqrt(q.x^2 + q.y^2 + q.z^2)

function _normalize(q::Q) where Q <: UnitQuaternion
n = norm(params(q))
Q(q.w/n, q.x/n, q.y/n, q.z/n)
Expand Down Expand Up @@ -262,7 +259,7 @@ end

function _log_as_quat(q::Q, eps=1e-6) where Q <: UnitQuaternion
# Assumes unit quaternion
θ = vecnorm(q)
θ = sqrt(q.x^2 + q.y^2 + q.z^2)
if θ > eps
M = atan(θ, q.w)/θ
else
Expand Down

0 comments on commit 09e0313

Please sign in to comment.