开发者

How to write mathematic formula in python

I try to write these formulas in python but with no luck

How to write mathematic formula in python

I have no errors in code but I know that calculation gives incorrect result so I guess I have

something wrong in implementation of formulas.


    import math
   lat = 54.5917455423
   lon = 17.2078876198

B = math.radians(lat)
L = math.radians(lon)
h = 55.889
pi = math.pi
a = 6378137
b = 6356752.3141
f = 1/298.257222101
ba = 1 - f# should be b/a = 1 - f

e = 0.006694380036
Da = 108
Df = - 4.80812 * 10 **-7
m = 0.000004848#one second in radians

dX = -23.74
dY = +123.83
dZ = +81.81
sin = math.sin
cos = math.cos
Rn = a/ math.sqrt(1-e**2 * math.sin(B)**2)
Rm = a*(1-e**2)/(1-e**2 * sin(B)**2)**(3/2)
vc = (Rm+h)*sin(m)

dB = (-dX*sin(B)*cos(L) - dY*sin(L) + dZ*cos(B) + Da*(Rn * e**2*sin(B)*cos(B)/a+Df)*(Rm*(a/b)+Rn*ba)*sin(B)*cos(B))*vc**-1
dL = (-dX * sin(L) + dY * cos(L) ) * ((Rn + h) * cos(B) * sin(m))**-1开发者_如何学Go

a = dB * 180/pi + B
b = dL *180/pi + L

print a
print b


This isn't Python:

b/a = 1 - f


This formula has errors in it:

dB = (-dX*sin(B)*cos(L) - dY*sin(L) + dZ*cos(B) 
    + Da*(Rn * e**2*sin(B)*cos(B)/a+Df)*(Rm*(a/b)+Rn*ba)*sin(B)*cos(B))*vc**-1

It should be:

dB = (  -dX*sin(B)*cos(L) - dY*sin(B)*sin(L) + dZ*cos(B)
        + Da*(Rn * e**2*sin(B)*cos(B)/a)
        + Df*(Rm*(a/b)+Rn*b/a)*sin(B)*cos(B)  )*vc**-1
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜