2022-05-08 02:13:33 +00:00
|
|
|
from cmath import e, sqrt
|
2021-12-27 01:54:37 +00:00
|
|
|
from _helpers import floatInput
|
|
|
|
|
2022-05-08 02:13:33 +00:00
|
|
|
i = sqrt(-1)
|
2021-12-27 01:54:37 +00:00
|
|
|
|
2022-05-08 02:13:33 +00:00
|
|
|
compute = lambda numerator, denominator: (numerator / denominator).real
|
|
|
|
sin = lambda x: compute(pow(e, i * x) - pow(e, -i * x), 2 * i)
|
|
|
|
cos = lambda x: compute(pow(e, i * x) + pow(e, -i * x), 2)
|
|
|
|
tan = lambda x: compute(pow(e, i * x) - pow(e, -i * x), i * (pow(e, i * x) + pow(e, -i * x)))
|
|
|
|
radians = floatInput("Please enter an amount of radians: ")
|
2021-12-27 01:54:37 +00:00
|
|
|
|
2022-05-08 02:13:33 +00:00
|
|
|
print(f"""
|
|
|
|
sin({radians}) = {sin(radians)})
|
|
|
|
cos({radians}) = {cos(radians)}
|
|
|
|
tan({radians}) = {tan(radians)}
|
2021-12-27 01:54:37 +00:00
|
|
|
|
2022-05-08 02:13:33 +00:00
|
|
|
csc({radians}) = {1 / sin(radians)}
|
|
|
|
sec({radians}) = {1 / cos(radians)}
|
|
|
|
cot({radians}) = {1 / tan(radians)}""")
|