我想根据点 AB 和 C 的位置计算点 D 的位置,我知道点 A 相对于 D 和 D 相对于 B 和 c 相对于 D 的角度。
实际上,点 AB 和 C 是我用 GPS 标记的 3 个位置,点 D 是我试图获取 GPS 位置的无线电项圈动物的位置。我通过知道无线电项圈动物相对于北方的方向获得的角度。
我已经编写了算法,但我知道我不能将 GPS 坐标直接放入其中,并且必须将它们转换为输入然后再输出。我一直在谷歌搜索,我有点困惑,笛卡尔或 UTM 的使用更适合这个吗?
如何将 GPS 转换为 UTM?我已经搜索过了,我有点困惑。一些转换谈到度分和秒,我的 GPS 似乎给了我一个额外的数字,所以它的 N 68.21.446 和 `w 12.14.284
如果它相关,我假设该区域在我的计算中是 2d 以使事情变得更简单一些。
这是代码,尽管我不确定是否需要它:
#10/09/2013
#Enter your points for locations A B and C
#AN and AW is your first GPS points AA is the angle
AN<-10
AW<-0
AA<-45
#BN and BW are your second
BN<-10
BW<-0
BA<-0
#CN and CW are your third
CN<-0
CW<-10
CA<-90
#Convert these to ?
#work out distance
#For each co ordinate and angle, you need to calculate y=mx+c to make a line
#From these 3 lines, you can work out where they intersect
#If the angle is 0 it wont work, so make it very close to 0.
if(AA==0) {AA<-0.00001}
if(BA==0) {BA<-0.00001}
if(CA==0) {CA<-0.00001}
#Convert all angles to radians
AAr<-(AA*pi)/180
BAr<-(BA*pi)/180
CAr<-(CA*pi)/180
#Calculate M which is 1/tan(b)
AM<-1/tan(AAr)
BM<-1/tan(BAr)
CM<-1/tan(CAr)
#Calculate C the equation constant
#c=y-m*x
AC<-AW-AM*AN
BC<-BW-BM*BN
CC<-CW-CM*CN
#Caclulate intersections
#A and B
XAB<-(AC-BC)/(BM-AM)
YAB<-(AM*XAB+AC)
#B and C
XBC<-(BC-CC)/(CM-BM)
YBC<-(BM*XBC+BC)
#C and A
XAC<-(CC-AC)/(AM-CM)
YAC<-(CM*XAC+CC)
#Work out average of these 3 points
(XofABC<-(XAB+XBC+XAC)/(3))
(YofABC<-(YAB+YBC+YAC)/(3))
#Convert this back into GPS coordinate
`