If p is your point, D is the distance, and θ is the heading-angle from the X-axis, p 新 .x = p 旧 .x + D * cos(θ) p 新 .y = p 旧 .y + D * sin(θ) pnew.x = pold.x + D * cos(θ) pnew.y = pold.y + D * sin(θ)不过,通常不使用存储距离和角度,而是使用 vectors (无需使用sin/cos)Rather than storing distances and angles, though, this is usually done using vectors (which removes the need for the sin/cos) 这篇关于将CGPoint沿特定方向移动一定距离... iphone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-29 18:29
查看更多