コード例 #1
0
ファイル: math_test.py プロジェクト: eugaang/pythontest
import math 

print(math.average(1,2,3))
コード例 #2
0
ファイル: module.py プロジェクト: yeonhodev/WEB2-python
'''
import math

print(math.average(1,2,3))
print(math.plus(3,4))
print(math.pi)
'''

from math import average, plus, pi

print(average(1, 2, 3))
print(plus(3, 4))
print(pi)
 def Calc_ModA_grade(self):
     '''The grade for Module A is the
     average score for all topics in the module'''
     return math.average(T1, T2)
コード例 #4
0
ファイル: module.py プロジェクト: youngbrovnik/WEB1
# import math

# print(math.average(10,20,30))
# print(math.pi)
# print(math.plus(10, 20))

from math import average, pi, plus

print(average(10, 20, 30))
print(pi)
print(plus(10, 20))
コード例 #5
0
    dlat = math.radians(lat2 - lat1)
    dlon = math.radians(lon2 - lon1)
    a = (math.sin(dlat / 2) * math.sin(dlat / 2) +
         math.cos(math.radians(lat1)) * math.cos(math.radians(lat2)) *
         math.sin(dlon / 2) * math.sin(dlon / 2))
    c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a))
    d = radius * c

    return d


d = distance((48.1372, 11.5756), (52.5186, 13.4083))
print(d)

X1 = X[0:10, :]
print(X1)

for i in X1:
    dist = 0.0
    distance_initial_lon = 0.0
    distance_initial_lat = 0.0
    temp = i[2]
    distance_initial_lon = i[0]
    distance_initail_lat = i[1]
    dist_intra = (1 / (i[0] * i[1]))
    while (i[2] == temp):
        dist = dist + distance((distance_initial_lat, distance_initial_lon),
                               (i[1], i[0]))
    dist_intra = dist_intra * dist
    dist_intra = math.average(dist_intra)
    print(dist_intra)