Sep-30-2019, 09:36 PM
Hi everyone,
im tryna write a program that prints an Approx of a sinus(x) using this:
sinus(x)=x-((x**3)/3!)+((x**5)/5!)-((x**7)/7!)+...
so in my code it doesnt even enter the while.
im tryna write a program that prints an Approx of a sinus(x) using this:
sinus(x)=x-((x**3)/3!)+((x**5)/5!)-((x**7)/7!)+...
so in my code it doesnt even enter the while.
x=float(input()) res=x from math import sin v=sin(x) sign=1 puis=1 s=1 while(v>res): puis=puis+2 sign=sign*(-1) for i in range(puis): s=s*i res=res+(sign*(x**puis)/s) print(res)