src/attitude.js
// arc(A, B) returns an axis-angle that rotates A to B along a great circle (shortest path)
arc(A, B) returns an axis-angle that rotates A to B along a great circle (shortest path)
arc ( A B ) returns an axis - angle that rotates A to B along a great circle ( shortest path )
function arc(A, B) {
  const a = cartesiand(A),
    b = cartesiand(B);
  const alpha = acos(dot(a, b)), 
    w = cross(a, b), 
    n = sqrt(dot(w, w)); 
  return !n
    ? { angle: dot(a, b) > 0 ? 0 : 180 }
    : {
        axis: sphericald([w[0] / n, w[1] / n, w[2] / n]),
        angle: alpha * degrees
      };
}
function arc ( A , B ) { const a = cartesiand ( A ) , b = cartesiand ( B ) ; const alpha = acos ( dot ( a , b ) ) , w = cross ( a , b ) , n = sqrt ( dot ( w , w ) ) ; return ! n ? { angle : dot ( a , b ) > 0 ? 0 : 180 } : { axis : sphericald ( [ w [ 0 ] / n , w [ 1 ] / n , w [ 2 ] / n ] ) , angle : alpha * degrees } ; }
arc(A, B) returns an axis-angle that rotates A to B along a great circle (shortest path)
arc ( A B ) returns an axis - angle that rotates A to B along a great circle ( shortest path )
// angle // axis direction // axis norm