You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/09/25 00:16:40 UTC

[GitHub] [commons-geometry] acid1103 commented on a change in pull request #39: GEOMETRY-46: Add additional UnitVector methods

acid1103 commented on a change in pull request #39: GEOMETRY-46: Add additional UnitVector methods
URL: https://github.com/apache/commons-geometry/pull/39#discussion_r327886108
 
 

 ##########
 File path: commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/Vector2D.java
 ##########
 @@ -565,5 +571,11 @@ public Vector2D normalize() {
         public Vector2D withNorm(final double mag) {
             return multiply(mag);
         }
+
+        /** {@inheritDoc} */
+        @Override
+        public UnitVector negate() {
+            return new UnitVector(-super.x, -super.y);
 
 Review comment:
   Removing super doesn't work, as the compiler thinks we're trying to access VectorXD.x statically, and using `this.x` doesn't work, as the compiler complains about VectorXD.x being private.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services