public static final Point3D minus(final Point3D p, final Point3D q) { return Point3DBuilder.create() .x(p.getX() - q.getX()) .y(p.getY() - q.getY()) .z(p.getZ() - q.getZ()) .build(); }
public static final Point3D crossProduct(final Point3D p, final Point3D q) { return Point3DBuilder.create() .x(p.getY() * q.getZ() - p.getZ() * q.getY()) .y(p.getZ() * q.getX() - p.getX() * q.getZ()) .z(p.getX() * q.getY() - p.getY() * q.getX()) .build(); }
public static final Point3D divide(final Point3D p, final double f) { return Point3DBuilder.create().x(p.getX() / f).y(p.getY() / f).z(p.getZ() / f).build(); }
public static final Point3D multiply(final double f, final Point3D p) { return Point3DBuilder.create().x(p.getX() * f).y(p.getY() * f).z(p.getZ() * f).build(); }
@Override public final Point3D apply(final Point3D point) { return Point3DBuilder.create().x(point.getX()).y(point.getY()).z(0).build(); }