-- | 'Packed' version of 'cross'.
-- TODO: move this function somewhere appropriate
crossp :: Vec3 Double -> Vec3 Double -> Vec3 Double
crossp a b = (a2*b3-a3*b2):.(a3*b1-a1*b3):.(a1*b2-a2*b1):.()
    where (a1,a2,a3) = (get n0 a, get n1 a, get n2 a)
          (b1,b2,b3) = (get n0 b, get n1 b, get n2 b)

-- | Like 'normalize', but returns the zero vector instead of NaN when the norm is zero.
-- TODO: move this function somewhere appropriate
crossp :: Vec3 Double -> Vec3 Double -> Vec3 Double
crossp a b = (a2*b3-a3*b2):.(a3*b1-a1*b3):.(a1*b2-a2*b1):.()
    where (a1,a2,a3) = (get n0 a, get n1 a, get n2 a)
          (b1,b2,b3) = (get n0 b, get n1 b, get n2 b)

-- | Like 'normalize', but returns the zero vector instead of NaN when the norm is zero.
-- TODO: move this function somewhere appropriate
crossp a b = (a2*b3-a3*b2):.(a3*b1-a1*b3):.(a1*b2-a2*b1):.()
    where (a1,a2,a3) = (get n0 a, get n1 a, get n2 a)
          (b1,b2,b3) = (get n0 b, get n1 b, get n2 b)

-- | Like 'normalize', but returns the zero vector instead of NaN when the norm is zero.
-- TODO: move this function somewhere appropriate