Finished segment_from_x_y_rotation method