You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Julien Anxionnat (JIRA)" <ji...@apache.org> on 2012/09/18 17:15:07 UTC

[jira] [Created] (MATH-863) new Quaternion class added in complex package

Julien Anxionnat created MATH-863:
-------------------------------------

             Summary: 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


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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460340#comment-13460340 ] 

Luc Maisonobe commented on MATH-863:
------------------------------------

Let's wait for Juliens's tests and adjust the javadoc accordingly.
We may end up having some classes supporting non-commutative fields and other requiring commutative fields and just state that in the doc, or we may add a CommutativeField marker interface which would extend Field, or we could add a isCommutative method in the Field interface and check that were needed. I'm not sure the Java typing mechanism is sufficient, so either simple documentation or runtime checks may be helpful.

If the test does not work at all and since your other example show it doesn't work either, then we could simply improve the interface javadoc saying that it only supports commutative fields.

                
> 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_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Julien Anxionnat (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13458525#comment-13458525 ] 

Julien Anxionnat commented on MATH-863:
---------------------------------------

Thanks for your comments.

Ok for creating two issues (Precision improvements and new Quaternion class), and for all your points.

I'll propose a new .patch asap just concerning the Quaternion.

Yannick (my coworker) will open the discussion about the improvements in the Precision class asap too.
                
> 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
>
>   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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13458743#comment-13458743 ] 

Gilles commented on MATH-863:
-----------------------------

bq. double[] rather than Vector3D

Actually, I meant to use three "double"s; I'm sorry if I was not clear.
This would have the advantage that the dimension check is not necessary.

For the comparisons, you sometimes use 1e-14 and sometimes "Precision.EPSILON". If there is a reason, it should probably be documented.
Maybe you can raise those issues on the "dev" ML.

To be consistent with what was done in the "Complex" class, I'd suggest to define only instance methods (the "static" ones have no advantage here) and to rename "product" as "multiply".

                
> 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460333#comment-13460333 ] 

Sébastien Brisard commented on MATH-863:
----------------------------------------

A good test would be {{FieldLUDecomposition}}. It might work, it might not. But even if it works, it would not tell us much. Indeed, we would have to make sure that _all_ classes operating on {{FieldElement}} take into account non-commutativity of the multiplication. There is no way to check that!

I can give you a counter example (not included in Commons-Math) : I've developed a {{Polynomial<T extends FieldElement<T>}} with coefficients as {{FieldElement}}s. Then I expand {{(a + b)^n}} using Pascal's rule [1]. While this is perfectly correct on a regular field, it would certainly fail on a {{Quaternion}} (if I understand correctly). If {{Quaternion}} implemented {{FieldElement}}, applying Pascal's rule would be allowed from the point of view of the compiler, although pure nonsense from a mathematical point of view.

Therefore, I think {{Quaternion}} *should not* implement {{FieldElement}}. Did I miss something? What do others think?

[1] {{(a + b)^2 = a^2 + a * b + b * a + b^2 != a^2 + 2 * a * b + b^2}} if {{*}} does not commute.
                
> 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13459714#comment-13459714 ] 

Gilles commented on MATH-863:
-----------------------------

Committed in revision 1388099, with some changes. Please test...

                
> 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Julien Anxionnat (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460456#comment-13460456 ] 

Julien Anxionnat commented on MATH-863:
---------------------------------------

The implementation is easy. But in my opinion, it's dangerous for the {{Quaternion}} to implement the {{FieldElement}} interface because of the non-commutativity of the multiplication.

I read some articles on mathworld and wikipedia. And I discovered there are ambiguities in the translation french/english which were confusing me:
* a _field_ *is* commutative ("field" = "corps commutatif" in french) ;
* a _division ring_ (or _skew field_) (= "corps" or "corps gauche" in french) is a field without  prerequisite on the commutativity or non-commutativity of the multiplication ;
* a _non-commutative field_ (= "corps non commutatif" in french) has a non-commutative multiplication.

So I suggest to :
# rename the {{Field}} interface into {{SkewField}} ;
# remove the {{multiply()}} and {{divide()}} methods from it ;
# create a new {{Field}} interface extending the {{Skewfield}} within the two "old" {{multiply()}} and {{divide()}} methods, and precise that this _field_ is commutative ;
# create a new {{NonCommutativeField}} extending the {{SkewField}} with the following methods:
** leftMultiply() : a * _this_,
** rightMultiply() : _this_ * a,
** leftDivide() : a ^-1^ * _this_,
** rightDivide() : _this_ * a ^-1^.

What do you think about ?

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_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460319#comment-13460319 ] 

Luc Maisonobe commented on MATH-863:
------------------------------------

Julien, Yannick, could you try and report if implementing FieldElement works or not?
                
> 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

[jira] [Updated] (MATH-863) new Quaternion class added in complex package

Posted by "Julien Anxionnat (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Anxionnat updated MATH-863:
----------------------------------

    Attachment: quaternion.patch
    
> 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
>
>   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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460348#comment-13460348 ] 

Sébastien Brisard commented on MATH-863:
----------------------------------------

{quote}
Let's wait for Juliens's tests and adjust the javadoc accordingly.
We may end up having some classes supporting non-commutative fields and other requiring commutative fields and just state that in the doc, or we may add a CommutativeField marker interface which would extend Field, or we could add a isCommutative method in the Field interface and check that were needed. I'm not sure the Java typing mechanism is sufficient, so either simple documentation or runtime checks may be helpful.
{quote}

These are all safe suggestions from my point of view. I have to say I always find it difficult to predict what's going to happen with generics, but maybe we could define a {{NonCommutativeFieldElement}}, move all methods from {{FieldElement}} to {{NonCommutativeFieldElement}}, and have {{FieldElement}} extend {{NonCommutativeFieldElement}}. This way, all classes that operate on field elements would by default not operate on non-commutative field elements. After careful check, if appropriate, we could change the signature
{{class A<T extends FieldElement<T>>}} to {{class A<T extends NonCommutativeFieldElement<T>>}}. Again, I'm not sure that would work.

Otherwise, the {{isCommutative()}} method should be invoked in the constructor of {{class A}}.
                
> 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_adjustments.patch, 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

[jira] [Resolved] (MATH-863) new Quaternion class added in complex package

Posted by "Gilles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles resolved MATH-863.
-------------------------

    Resolution: Fixed
    
> 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
>             Fix For: 3.1
>
>         Attachments: quaternion_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Julien Anxionnat (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460342#comment-13460342 ] 

Julien Anxionnat commented on MATH-863:
---------------------------------------

I just uploaded a "quaternion_adjustments.patch" as announced.
                
> 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_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460414#comment-13460414 ] 

Gilles commented on MATH-863:
-----------------------------

Last patch applied in revision 1388406.

                
> 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_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Julien Anxionnat (JIRA)" <ji...@apache.org>.
    [ 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

[jira] [Comment Edited] (MATH-863) new Quaternion class added in complex package

Posted by "Julien Anxionnat (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13458721#comment-13458721 ] 

Julien Anxionnat edited comment on MATH-863 at 9/20/12 1:42 AM:
----------------------------------------------------------------

I just took into account your comments :
- javadoc reformating ;
- double[] rather than Vector3D ;
- no more Precision improvements.
I hope this is better.
                
      was (Author: julien_a):
    Taking into account the comments of Gilles.
                  
> 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460304#comment-13460304 ] 

Luc Maisonobe commented on MATH-863:
------------------------------------

Wouldn't it be better to stick with multiply as the method name and have Quaternion implement the FiledElement interface?

In this case, a (very simple) QuaternionField companion class should be needed. This would allow using Quaternion instances as elements to some of the linear algebra methods (like LU decomposition and solver).

As Julien mentioned he wanted to have the pure mathematical object, it makes sense to complete the job.
                
> 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460536#comment-13460536 ] 

Luc Maisonobe commented on MATH-863:
------------------------------------

I think we are drifting away from the original goal to have a Quaternion class...

If this class cannot implement Field because of commutativity problems, then don't implement the interface.
For now, there is no use of non-commutative Field. Sébastien already pointed out his Polynomial implementation would fail with them, and there is a high risk LUDecompistion would also fail.

I would suggest to just do a quick test on LUDecomposition and if as expected it fails then drop the idea entirely. Implementing the interface is not for the pure mathematical elegance, we do it only if it serves some purpose.
                
> 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_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460309#comment-13460309 ] 

Sébastien Brisard commented on MATH-863:
----------------------------------------

{quote}
[...] have Quaternion implement the FiledElement interface
{quote}

I was about to make the same suggestion! However, on second thoughts, I'm not so sure, because of the product being non commutative. I am not sure all classes operating on FieldElements are cautious enough about the product possibly being non-commutative. It might therefore be dangerous to have {{Quaternion}} implement {{FieldElement}}. However, I agree with Luc: even if {{Quaternion}} does not implement {{FieldElement}}, similar methods should definitely be given the same name.

Sébastien
                
> 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460487#comment-13460487 ] 

Sébastien Brisard commented on MATH-863:
----------------------------------------

If you like {{leftMultiply}}, feel free to add it, so long as {{a.multiply(b)}} reads from left to right... How about we call {{leftMultiply}} {{weirdMultiply}} ;)


In fact, thinking about it, there might be a gain in implementing {{leftMultiply}}: if we were to create a {{Real}} class which would be a subclass of {{Quaternion}}, Real.leftMultiply(Quaternion) would be much faster than Quaternion.rightMultiply(Real).
                
> 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_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Julien Anxionnat (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13461645#comment-13461645 ] 

Julien Anxionnat commented on MATH-863:
---------------------------------------

Hello,

I think there'll be changes on too many classes. And as Luc said, these changes are useless for the moment. I tried to implement this {{SkewField}} interface and there many impacts on existinf classes.

+1 to resolve this issue.

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
>             Fix For: 3.1
>
>         Attachments: quaternion_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Julien Anxionnat (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460483#comment-13460483 ] 

Julien Anxionnat commented on MATH-863:
---------------------------------------

Ok for me. It's more user-friendly.
(Maybe a {{leftMulitply}} method would be made {{SkewfieldElement}} more consistent ?)

I can provide a .patch if everyone is ok.

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_adjustments.patch, 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

[jira] [Updated] (MATH-863) new Quaternion class added in complex package

Posted by "Julien Anxionnat (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Anxionnat updated MATH-863:
----------------------------------

    Attachment: quaternion_adjustments.patch
    
> 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_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460471#comment-13460471 ] 

Sébastien Brisard commented on MATH-863:
----------------------------------------

I personally don't like {{leftMultiply}} and {{rightMultiply}}, for three reasons
# who is meant to stand on the left/right is not intuitive to me
# I can't see the gain of {{this.leftMultiply(a)}} over {{a.rightMultiply(this)}}
# {{FieldElement}} has a fluent interface. So you could write something like {{a.add(b.rightMultiply(c))}}, which reads how it should, namely {{a + (b * c)}}, while {{a.add(b.leftMultiply(c))}} should read the other way {{a + (c * b)}}, which somehow breaks the fluent interface.

Besides, I don't understand why {{SkewField}} should not be equipped with a multiplication/division (with no assumption on commutativity), while the mathematical definition of a skew field clearly states that there is a multiplication/division.

How about
# we create a superinterface of {{FieldElement}}, for example {{SkewFieldElement}} which is *not necessarily* commutative, and we say so in the Javadoc. This interface has the same methods as {{FieldElement}} *including* {{multiply}} and {{divide}} (basically we move all methods from {{FieldElement}} to {{SkewFieldElement}}, and {{FieldElement}} becomes a marker interface). {{multiply}} would effectively be what Julien named {{rightMultiply}}, and there is no need in my view to provide a {{leftMultiply}} (or maybe I'm missing something?)
# we clearly state in the interface that {{FieldElement}} *is* commutative

                
> 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_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13458256#comment-13458256 ] 

Gilles commented on MATH-863:
-----------------------------

Thanks for the proposed implementations.

No need to apologize... ;)

Concerning the Javadoc formatting (it's a hot topic at the moment, see MATH-852):
* Do not insert a ":" character between the parameter's name and description.
* It's no necessary to tag all methods with "@since 3.1" (since the entire class is new).

There are other little things... Some remarks that have been listed in MATH-815 might also apply here.

One important thing is to provide separate patches for independent issues:
# New methods for {{Precision}} class
# Quaternion implementation

If I read carefully, the "equalsWithRelativeTolerance" is used at only one place in "Quaternion", and at that place, I think that the existing "Precision.equals" method could be used instead.
Anyways, the proposal for the new methods should be discussed on the "dev" ML, and handled in a separate JIRA ticket.

About the "Quaternion" class, some points need clarification:
* "static" methods might have to be replaced by instance methods (as in class "Complex").
* "isEqualTo" should probably be replaced by the standard "equals" method.
* It might be better to avoid referring to "Vector3D" inside this class: Some methods are only syntactic sugar (grouping 3 scalars in 1 vector) or utilities probably best defined somewhere in the "geometry" package.

Could you please open a discussion on the "dev" ML?

                
> 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
>
>   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

[jira] [Updated] (MATH-863) new Quaternion class added in complex package

Posted by "Julien Anxionnat (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Anxionnat updated MATH-863:
----------------------------------

    Attachment: quaternion_v2.patch

Taking into account the comments of Gilles.
                
> 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Yannick TANGUY (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460298#comment-13460298 ] 

Yannick TANGUY commented on MATH-863:
-------------------------------------

Hi Gilles,

Thanks for the commit ; I tested it and have some comments : 
- there's a mistake in "double dotProduct(Quaternion q)" method : it calls itself, instead of "return dotProduct(this,q)", and was not covered in the junit test
- I also noticed that you removed the following methods : isIdentityQuaternion (ok for me) and product(double[] v) -> I think the second one was useful.. 
- Why does there's a static method "product(Quaternion, Quaternion)" and another method "multiply(Quaternion)". I suggest to keep "product(Quaternion)", in reference to Hamilton product and to keep multiply (or the former and more explicit scalarMultiply) for the scalar multiplication.

Yannick

                
> 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

[jira] [Updated] (MATH-863) new Quaternion class added in complex package

Posted by "Gilles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles updated MATH-863:
------------------------

    Fix Version/s: 3.1
    
> 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
>             Fix For: 3.1
>
>         Attachments: quaternion_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13461236#comment-13461236 ] 

Gilles commented on MATH-863:
-----------------------------

If the class contains a working implementation of the basic functionality of a quaternion, I propose to resolve this issue. The class can be enhanced later if needed (through a new JIRA ticket).

                
> 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
>             Fix For: 3.1
>
>         Attachments: quaternion_adjustments.patch, 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

[jira] [Commented] (MATH-863) new Quaternion class added in complex package

Posted by "Julien Anxionnat (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460321#comment-13460321 ] 

Julien Anxionnat commented on MATH-863:
---------------------------------------

Thanks a lot for the commit.

I'll provide in few minutes a little .patch for the "multiply" name and the mistakes Yannick revealed (dotProduct, junit test).

About the removal of the {{product(double[] v)}} method (and the two static q.v and v.q), I'm ok : with {{Quaternion(double[] v)}}, the user could easily computes these products.

And I can try the FieldElement implementation.

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