Ported line2d.d and quaternion.d