-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmisc.py
More file actions
32 lines (24 loc) · 656 Bytes
/
misc.py
File metadata and controls
32 lines (24 loc) · 656 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import math
def distance(pos1, pos2 = (0, 0, 0)) -> float:
return math.sqrt((pos1[0] - pos2[0]) ** 2 + (pos1[1] - pos2[1]) ** 2 + (pos1[2] - pos2[2]) ** 2)
StarType = {
"MainSeqStar": 1,
"GiantStar": 2,
"WhiteDwarf": 3,
"NeutronStar": 4,
"BlackHole": 5
}
SpectrType = {
"M": -4,
"K": -3,
"G": -2,
"F": -1,
"A": 0,
"B": 1,
"O": 2,
"X": 3
}
veins = ["iron", "copper", "silicium", "titanium", "stone", "coal", "oil", "fireice", "diamond", "fractal", "crysrub",
"grat", "bamboo", "mag"]
def no_indent(s: str) -> str:
return '\n'.join(map(str.lstrip, s.splitlines())).lstrip('\n')