Skip to content

Instantly share code, notes, and snippets.

@msaroufim
Created November 28, 2019 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save msaroufim/40a621e96fd65bae664f2a9b3f38eee5 to your computer and use it in GitHub Desktop.
Save msaroufim/40a621e96fd65bae664f2a9b3f38eee5 to your computer and use it in GitHub Desktop.
function MatrixExp3(so3mat::Array)
omgtheta = so3ToVec(so3mat)
if NearZero(linalg.norm(omgtheta))
return linalg.I
else
θ = AxisAng3(omgtheta)[2]
omgmat = so3mat / θ
return linalg.I + sin(θ) * omgmat + (1 - cos(θ)) * omgmat * omgmat
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment