Rak*_*oui 3 math geometry polar-coordinates cartesian-coordinates
我在笛卡尔坐标系中有一个点,例如: x = 3&y = 5
我想在给定方向(以度为单位)上移动一段距离后,获得该点的新坐标。
如何获得新的x和新的y?
学校几何学中的著名公式:
new_x = x + distance * Math.Cos(angle_degrees * Math.Pi / 180)
new_y = y + distance * Math.Sin(angle_degrees * Math.Pi / 180)
Run Code Online (Sandbox Code Playgroud)
请注意,angle_degrees = "given direction"是从x轴的正向y轴向测量