【发布时间】:2014-04-25 06:49:31
【问题描述】:
是否已经在 Python 中实现了使用以度 (°) 表示的给定角度从点 A (x0, Y0) 找到点 B 的 X、Y 的函数?
from math import cos, sin
def point_position(x0, y0, dist, theta):
return dist*sin(theta), dist*cos(theta)
其中x0 = A 点的 x 坐标,y0 = A 点的 y 坐标,dist = A 和 B 之间的距离,theta = B 点相对于北方的角度 (°) ( 0°) 用指南针测量
【问题讨论】:
-
您需要将 x0 和 y0 添加到返回值中。
标签: python coordinates distance trigonometry angle