return this;
}
+ /**
+ * Add coordinates of current point to other point. Value of current point will not be changed.
+ * @return current point.
+ */
+ public Point3D addTo(final Point3D ... otherPoints) {
+ for (final Point3D otherPoint : otherPoints) otherPoint.add(this);
+ return this;
+ }
+
+ /**
+ * Create new point by cloning position of current point.
+ *
+ * @return newly created clone.
+ */
public Point3D clone() {
return new Point3D(this);
}
* @param angleXZ angle around XZ axis.
* @param angleYZ angle around YZ axis.
*/
- public void rotate(final Point3D center, final double angleXZ,
+ public Point3D rotate(final Point3D center, final double angleXZ,
final double angleYZ) {
final double s1 = sin(angleXZ);
final double c1 = cos(angleXZ);
x = x1 + center.x;
y = y1 + center.y;
z = z2 + center.z;
+
+ return this;
+ }
+
+ public Point3D rotate(final double angleXZ, final double angleYZ) {
+ return rotate(new Point3D(0, 0, 0), angleXZ, angleYZ);
}
/**