public static Angle axisAngle(Vec4 v1,Vec4 v2,Vec4[] result){
  if (v1 == null || v2 == null) {
    throw new IllegalArgumentException("Vec4 Is Null");
  }
  if (result == null) {
    throw new IllegalArgumentException("Array Is Null");
  }
  Vec4 u1=v1.normalize3();
  Vec4 u0=v2.normalize3();
  Angle angle=Angle.fromRadians(Math.acos(u0.x * u1.x + u0.y * u1.y + u0.z * u1.z));
  double A=(u0.y * u1.z) - (u0.z * u1.y);
  double B=(u0.z * u1.x) - (u0.x * u1.z);
  double C=(u0.x * u1.y) - (u0.y * u1.x);
  double L=Math.sqrt(A * A + B * B + C * C);
  result[0]=new Vec4(A / L,B / L,C / L);
  return angle;
}

public static Angle axisAngle ( Vec4 v1 , Vec4 v2 , Vec4 [ ] result ) { if ( v1 == null || v2 == null ) { throw new IllegalArgumentException ( "Vec4 Is Null" ) ; } if ( result == null ) { throw new IllegalArgumentException ( "Array Is Null" ) ; } Vec4 u1 = v1 . normalize3 ( ) ; Vec4 u0 = v2 . normalize3 ( ) ; Angle angle = Angle . fromRadians ( Math . acos ( u0 . x * u1 . x + u0 . y * u1 . y + u0 . z * u1 . z ) ) ; double A = ( u0 . y * u1 . z ) - ( u0 . z * u1 . y ) ; double B = ( u0 . z * u1 . x ) - ( u0 . x * u1 . z ) ; double C = ( u0 . x * u1 . y ) - ( u0 . y * u1 . x ) ; double L = Math . sqrt ( A * A + B * B + C * C ) ; result [ 0 ] = new Vec4 ( A / L , B / L , C / L ) ; return angle ; }
compute the angle and rotation axis required to rotate one vector to align with another .
