The factors affecting the drill trajectory were analyzed to improve the trajectory accuracy in horizontal directional drilling.The engineering equations were simplified and optimized to show how to reduce the trajectory error caused by measurement errors.Simulations with real environmental parameters showed that the errors were reduced by the optimization.Thus,the results give guidance on how to improve the trajectory accuracy.