[
https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13459464#comment-13459464
]
Julien Anxionnat commented on MATH-863:
---------------------------------------
Thanks for your feedback.
In fact, in our applications (satellite attitude guidance), we have
interactions with {{Vector3D}} (for geometry abilities) and {{Quaternion}}. And
we need some practical methods.
(It's the reason why some months ago we proposed to add {{Quaternion}} in the
{{geometry.threed}} package.)
I understand and agree with the need to avoid referring {{Vector3D}} in this
{{Quaternion}} class in {{complex}} package.
But the double array is very practical. It's very more handy to construct a
quaternion with:
{{new Quaternion(myScalar, myVector3D.toArray())}}
than:
{{new Quaternion(myScalar, myVector3D.getX(), myVector3D.getY(),
myVector3D.getZ())}}
and to construct a {{Vector3D}} with:
{{new Vector3D(myQuaternion.getVectorPart())}}
than:
{{new Vector3D(myQuaternion.getQ1(), myQuaternion.getQ2(),
myQuaternion.getQ3())}}
The static methods have some advantages because of the noncommutativity of the
multiplication. I'm ok to remove the {{add()}}, {{dotProduct()}} and
{{subtract()}} static methods, but not the {{product(...)}} ones.
The name "product" was chosen in reference to the "Hamilton's product", but
I've no objections to call it "multiply".
About the {{Precision}} subject and the "magic" 1E-14, I'll join the hot topic
on the ML. ;)
Julien
> new Quaternion class added in complex package
> ---------------------------------------------
>
> Key: MATH-863
> URL: https://issues.apache.org/jira/browse/MATH-863
> Project: Commons Math
> Issue Type: New Feature
> Affects Versions: 3.1
> Reporter: Julien Anxionnat
> Attachments: quaternion.patch, quaternion_v2.patch
>
> Original Estimate: 0h
> Remaining Estimate: 0h
>
> This patch provides a new class for the mathematical object "Quaternion" in
> the complex package.
> This quaternion is considered as a mathematical object (the Hamilton's
> hypercomplex number).
> Note that it's not a rotation quaternion which has to be a quaternion of norm
> one. Although this feature could be used for a getter in the Rotation class.
> This patch provides also some improvements in Precision class : a "double
> comparison epsilon" and a method to compute relative comparison.
> (Please, note that's it's my first contribution, and I apologize in advance
> for my mistakes…)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira