Sinx= x- (x3/3!)+ (x5/5!)- (x7/7!)+.......


I can't solve it
Please help me........

[img]http://upload.wikimedia.org/math/e/7/2/e72a9c97103eed0fe72a1975a8fd748a.png[/img]
[TEX]sin(x) = x - x^3/3! + x^5/5! - x^7/7!...[/TEX]

In C++ terms :

//approximates in 3 expansions
float sinus(float x){
 return x - (x*x*x)/(3*2*1) + (x*x*x*x*x)/(5*4*3*2*1);
}

Of course you can use a for loop and a factorial function and a power function to expand it more, but I'm not trying to give you the answer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.