Exemple #1
0
 public Point translate(Point delta) {
   Point p = toUnit(delta.unit);
   p.x += delta.x;
   p.y += delta.y;
   p.z += delta.z;
   return p;
 }
Exemple #2
0
 public Point diff(Point p) {
   p = p.toUnit(unit);
   p.x -= x;
   p.y -= y;
   p.z -= z;
   return p;
 }
Exemple #3
0
 public void translateI(Point delta) {
   if (delta.unit != unit) {
     delta = delta.toUnit(unit);
   }
   x += delta.x;
   y += delta.y;
   z += delta.z;
 }
Exemple #4
0
 public double distance2(Point p) {
   if (p.unit != unit) {
     p = p.toUnit(unit);
   }
   return (p.x - x) * (p.x - x) + (p.y - y) * (p.y - y) + (p.z - z) * (p.z - z);
 }
Exemple #5
0
 public double distance(Point p) {
   if (p.unit != unit) {
     p = p.toUnit(unit);
   }
   return Math.sqrt((p.x - x) * (p.x - x) + (p.y - y) * (p.y - y) + (p.z - z) * (p.z - z));
 }