stud/III/Ovodas/task1.py

50 lines
830 B
Python
Raw Normal View History

2020-12-14 16:09:54 +02:00
#!/usr/bin/python3
2020-12-27 12:17:41 +02:00
from math import sin, cos, sqrt, e, log, radians, degrees
def sinq(x):
return sin(x)**2
def sqr(x):
return x**2
2020-12-14 16:09:54 +02:00
# duota
B = radians(13)
# didysis pusašis
a = 6378137
# suspaudimas
alpha = 1/298.25722
# mažasis pusašis
b = a*(1-alpha)
# ekscentricitetas
e2 = (a**2-b**2)/(a**2)
# meridiano kreivumo spindulys
M = a*(1-e2)/((1-e2*sinq(B))**3/2)
# meridiano vertikalės kreivumo spindulys
N = a/sqrt(1-e2*sinq(B))
# vidutinis kreivumo spindulys
R = sqrt(M*N)
# lygiagretės spindulys
r = N * cos(B)
# Lygiagretės lanko ilgis metrais
Sn = r/degrees(1)
2020-12-27 12:17:41 +02:00
# Trapecijos plotas esant 1 radiano platumai
2020-12-14 16:09:54 +02:00
P = sqr(b)/2 * ( sin(B)/(1-e2*sinq(B)) + 1/(2*e)*log( (1+e*sin(B))/(1-e*sin(B)) ) )
g = globals()
for v in ["b", "e2", "M", "N", "R", "r", "Sn", "P"]:
print("%2s: %18.4f" % (v, g[v]))