谷歌地图两个圆的交点
问题描述
有没有一种简单的方法来获取两个
和我们的
如果给定的圆半径Rd是公里,那么
现在我们可以找到角度了
起始方位(AF方向):
交叉点的方位:
交点坐标:
同样适用于 D_bearing
latB, lonB 以弧度为单位
Is there an easy way to get the lat
/lng
of the intersection points (if available) of two circles in Google Maps API V3? Or should I go with the hard way?
EDIT : In my problem, circles always have the same radius, in case that makes the solution easier.
Yes, for equal circles rather simple solution could be elaborated:
Let's first circle center is A point, second circle center is F, midpoint is C, and intersection points are B,D. ABC is right-angle spherical triangle with right angle C.
We want to find angle A - this is deviation angle from A-F direction. Spherical trigonometry (Napier's rules for right spherical triangles) gives us formula:
cos(A)= tg(AC) * ctg(AB)
where one symbol denote spherical angle, double symbols denote great circle arcs' angles (AB, AC). We can see that AB = circle radius (in radians, of course), AC = half-distance between A and F on the great circle arc.
To find AC (and other values) - I'll use code from this excellent page
and our
If circle radius Rd is given is kilometers, then
Now we can find angle
Starting bearing (AF direction):
Intersection points' bearings:
Intersection points' coordinates:
and the same for D_bearing
latB, lonB are in radians
这篇关于谷歌地图两个圆的交点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!