public Vector(final Vector A,final Vector B){
  final double thisX=A.y * B.z - A.z * B.y;
  final double thisY=A.z * B.x - A.x * B.z;
  final double thisZ=A.x * B.y - A.y * B.x;
  final double magnitude=magnitude(thisX,thisY,thisZ);
  if (Math.abs(magnitude) < MINIMUM_RESOLUTION) {
    throw new IllegalArgumentException("Degenerate/parallel vector constructed");
  }
  final double inverseMagnitude=1.0 / magnitude;
  this.x=thisX * inverseMagnitude;
  this.y=thisY * inverseMagnitude;
  this.z=thisZ * inverseMagnitude;
}

public Vector ( final Vector A , final Vector B ) { final double thisX = A . y * B . z - A . z * B . y ; final double thisY = A . z * B . x - A . x * B . z ; final double thisZ = A . x * B . y - A . y * B . x ; final double magnitude = magnitude ( thisX , thisY , thisZ ) ; if ( Math . abs ( magnitude ) < MINIMUM_RESOLUTION ) { throw new IllegalArgumentException ( "Degenerate/parallel vector constructed" ) ; } final double inverseMagnitude = 1.0 / magnitude ; this . x = thisX * inverseMagnitude ; this . y = thisY * inverseMagnitude ; this . z = thisZ * inverseMagnitude ; }
construct a vector that is perpendicular to two other ( non - zero ) vectors . if the vectors are parallel , illegalargumentexception will be thrown . produces a normalized final vector .
