public double Dist2(Vect3 p2) { return((p2.x - x) * (p2.x - x) + (p2.y - y) * (p2.y - y) + (p2.z - z) * (p2.z - z)); }
public double Dot(Vect3 v) { return(x * v.x + y * v.y + z * v.z); }
public Vect3(Vect3 p1, Vect3 p2) { x = p2.x - p1.x; y = p2.y - p1.y; z = p2.z - p1.z; }