+ 4

How do I make an arcsin function?

I've made sin and cos functions fork my code, bit I need an arcsin (sin raised to negative one) on my code. So far I've done this: Def arcsin(x): ____x = sin(z) ____return(z) But that doesn't work because it doesn't recognize z. Any help is appreciated.

8th Mar 2017, 11:30 PM
Slitherboy
Slitherboy - avatar
3 Answers
+ 5
you can't have x = sin(z) return z you need a representation of the function itself, not by its inverse. https://en.wikipedia.org/wiki/Inverse_trigonometric_functions#Infinite_series here you can find a way to express arcsin by an "infinite" series. Also, arcsin isn't sine to negative one, it's just a notation.
9th Mar 2017, 8:50 AM
Norayr Gasparyan
Norayr Gasparyan - avatar
+ 2
a = 5.13 b = 5.13 c = 0 capa = 0 capb = 0 capc = 60 radian = 180 / 3.14159265 def sin(x): x = x / radian return(x - ((x ** 3) / 6) + ((x ** 5) / 120) - ((x ** 7) / 120 / 42) + ((x ** 9) / 9 / 56 / 30 / 24)) def cos(x): x = x / radian return(1 - ((x ** 2) / 2) + ((x ** 4) / 24) - ((x ** 6) / 720) + ((x ** 8) / 56 / 720) - ((x ** 10) / 90 / 56 / 720)) def arcsin(x): x = sin(z) return(z) This is the first part of my code (it's for triangles)
8th Mar 2017, 11:32 PM
Slitherboy
Slitherboy - avatar