-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdegreesMath.py
More file actions
44 lines (26 loc) · 758 Bytes
/
Copy pathdegreesMath.py
File metadata and controls
44 lines (26 loc) · 758 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
33
34
35
36
37
38
39
40
41
42
43
44
"""
Custom Math Class that uses Degrees instead of Radians
"""
from math import sin as oSin
from math import cos as oCos
from math import tan as oTan
from math import asin as oASin
from math import acos as oACos
from math import atan as oATan
from math import pi
def sin(angle: float):
return oSin(angle * pi / 180)
def cos(angle: float):
return oCos(angle * pi / 180)
def tan(angle: float):
return oTan(angle * pi / 180)
def asin(division: float):
return oASin(division) * 180 / pi
def acos(division: float):
return oACos(division) * 180 / pi
def atan(division: float):
return oATan(division) * 180 / pi
def average(*args):
return sum(args) / len(args)
def pythagoras(a, b):
return (a ** 2 + b ** 2) ** 0.5