我正在尝试编程一个公式来计算绘制弧时的新角度 . 如果我用图片解释它可能会更好 .
上图是我在谷歌地球上绘制的图片 .
目前我有一个函数,绘制一个弧给定一个(x,y)枢轴点,轴承和半径的距离
在绘图上绘制此弧(距离原点最远的弧)后,我需要移动原点,例如 . 如果轴承是170度,则左侧线路将从170-90开始,右侧线路将以170°90开始
我无法找到较小同心圆中的角度(或方位)公式 . 我想提前感谢任何人提供的任何帮助 .
这是我计算和绘制弧的公式
def drawArc(lat1,lon1,lbearing,rbearing,hr): #draw Arc given lat/lon piviot point with the right and left bearing to draw the path and distance
arcstr=""
if rbearing < lbearing: #if the left bearing is already bigger than the right bearing, switch places. Test Case not proven yet! with winds coming from the east
lbearing,rbearing = rbearing,lbearing
while lbearing < rbearing:
arc1,arc2 = getEndpoint(lat1,lon1,lbearing,hr) #arc1 and arc2 are lat and lon respectively
arcCoord = "%f,%f,0\n"%(arc2,arc1)
arcstr+=arcCoord
lbearing+=1 #count
#attach the last remaining point which is the end point at the right bearing
arc1,arc2 = getEndpoint(lat1,lon1,rbearing,hr) #arc1 and arc2 are lat and lon respectively
arcCoord = "%f,%f,0\n"%(arc2,arc1)
arcstr+=arcCoord
return arcstr
要绘制三个Arc,这里是调用函数的位置:
arc3=drawArc(latitude,longitude,leBearing,reBearing,arc3hr)
arc2=drawArc(latitude,longitude,leBearing-(SOME FORMULA TO GIVE ME THE EXTRA ANGLE/BEARING TO INTERSECT WITH THE OUTER LINE),reBearing+(SAME FORMULA HERE),arc2hr)
arc1=drawArc(latitude,longitude,leBearing-(SOME FORMULA TO GIVE ME THE EXTRA ANGLE/BEARING TO INTERSECT WITH THE OUTER LINE),reBearing+(SAME FORMULA HERE),arc1hr)
这张照片上的已知点数:
-
纬度/经度的原点
-
每条线的距离和方位
-
原点半径半径为10海里,外圆为20NM
这是一张简化的图片,我相信角度θ是我正在寻找的
1 回答
这是必要的几何图形,假设我正确地解释了您的描述和图片 . 下图(和linked)显示您的图片,其中包含我们需要为theta解决的变量 .
现在,数学 . 这利用了sines / cosines的法律 .
余弦定律给了我们:
因此我们必须求解h,g和f,然后取结果的反余弦来得到theta .
根据正义法则......
我们可以立即用余弦法来解决:
要找到段x_1和x_2的长度,我们需要角度theta_1,2,3 ...
使用这些角度和更多的正弦定律给我们x_1和x_2 ......
把这一切放在一起就可以了
只需取代
的正确值,取决于你选择的d(或DIST),就把这个混乱中的
. 我不打算在这里写 .