kvark's picture

[Math] Add Quaternion.ShortestArc(v1,v2) routine

Project:The Open Toolkit library
Version:1.x-dev
Component:Code
Category:feature request
Priority:minor
Assigned:Unassigned
Status:open
Description
quaternion q;
vector3 c = cross(v1,v2);
q.v = c;
if ( vectors are known to be unit length ) {
    q.w = 1 + dot(v1,v2);
} else {
    q.w = sqrt(v1.length_squared() * v2.length_squared()) + dot(v1,v2);
}
q.normalize();
return q;

Taken from http://www.euclideanspace.com/maths/algebra/vectors/angleBetween/minorlo...


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Version:0.9.x-dev» 1.x-dev

0.9.x series is in feature freeze for the 1.0 release, so this will have to wait for 1.1.