Factor out the rotate_vector/rotate_point and mirror_point functions into utilities
Factor out thread generation to generic trapezoidal_thread module