Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
 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();
 }
Exemplo n.º 5
0
 @Override
 public final Point3D apply(final Point3D point) {
   return Point3DBuilder.create().x(point.getX()).y(point.getY()).z(0).build();
 }