在给定方向上通过距离移动笛卡尔坐标中的点
Move point in cartesian coordinate through distance in the given direction
例如,我在笛卡尔坐标系中有一个点:
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)
注意angle_degrees = "given direction"
是从正x轴向正y轴移动
例如,我在笛卡尔坐标系中有一个点: 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)
注意angle_degrees = "given direction"
是从正x轴向正y轴移动