在直角坐标中沿给定方向在距离上移动点

Rak*_*oui 3 math geometry polar-coordinates cartesian-coordinates

我在笛卡尔坐标系中有一个点,例如: x = 3y = 5

我想在给定方向(以度为单位)上移动一段距离后,获得该点的新坐标。

如何获得新的x和新的y?

MBo*_*MBo 6

学校几何学中的著名公式:

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轴向测量

  • 应该指出的是,只有当从正x轴向正y轴移动来测量度数的“角度”时,此方法才有效。 (6认同)