An optimization method for paleomagnetic Euler pole analysis