Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
cluster1 = []
cluster2 = []
for i in f:
s = i
s = s.replace(',', '.',2)
s = s.split()
x = float(s[0])
y = float(s[1])
if 2<x<6 and 0<y<10:
cluster1.append((x,y))
if 3<x<7 and 20<y<30:
cluster2.append((x,y))
def centr(cluster):
xcentr = 0
ycentr = 0
minm = 100**10000
for i in range(len(cluster)):
res = 0
for j in range(len(cluster)):
x1 = cluster [0]
y1 = cluster [1]
x2 = cluster[j][0]
y2 = cluster[j][1]
res += ((x2-x1)**2+(y2-y1)**2)**0.5
if res<minm:
minm=res
xcentr = x1
ycentr = y1
return xcentr, ycentr
x1 = centr(cluster1)[0]
y1 = centr(cluster1)[1]
x2 = centr(cluster2)[0]
y2 = centr(cluster2)[1]
print((x1+x2)/2*10000, (y1+y2)/2*10000)