The method of orienting curves and its application to manipulator trajectory planning