X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fgeometry%2FPoint2D.java;h=a82382fb65e2cbcd8ab7f1e25fba0847f6d6fdec;hb=316a696bf9db6e8eddf90ef3df5e1119481c0192;hp=71ad56419ffa6e502497ae66b99d835b4b3e1aae;hpb=0590faa0f0434ebb29955a711299f8ad5ac226d6;p=sixth-3d.git diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java index 71ad564..a82382f 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java @@ -1,12 +1,7 @@ /* - * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 3 of the GNU Lesser General Public License - * or later as published by the Free Software Foundation. - * + * Sixth 3D engine. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. */ - package eu.svjatoslav.sixth.e3d.geometry; import static java.lang.Math.sqrt; @@ -23,14 +18,19 @@ public class Point2D implements Cloneable { this.y = y; } - public Point2D(final Point2D source) { - x = source.x; - y = source.y; + public Point2D(final Point2D parent) { + x = parent.x; + y = parent.y; } - public Point2D add(final Point2D direction) { - x += direction.x; - y += direction.y; + /** + * Add other point to current point. + * + * @return current point. + */ + public Point2D add(final Point2D otherPoint) { + x += otherPoint.x; + y += otherPoint.y; return this; } @@ -43,9 +43,9 @@ public class Point2D implements Cloneable { return new Point2D(this); } - public void clone(final Point2D source) { - x = source.x; - y = source.y; + public void clone(final Point2D parent) { + x = parent.x; + y = parent.y; } public Point2D getMiddle(final Point2D p1, final Point2D p2) { @@ -83,9 +83,14 @@ public class Point2D implements Cloneable { y = (int) y; } - public Point2D subtract(final Point2D point) { - x -= point.x; - y -= point.y; + /** + * Subtract other point from current point. + * + * @return current point. + */ + public Point2D subtract(final Point2D otherPoint) { + x -= otherPoint.x; + y -= otherPoint.y; return this; }