/*
- * 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;
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;
}
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) {
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;
}