can someone check this for me?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wuzertheloser
    New Member
    • Oct 2006
    • 22

    can someone check this for me?

    sum += pow(-1., (double)n) * ((pow((2. * angle_rad),(2. * (double)n))) / factori
    al);
    value = 0.5 * (1 + sum);


    this is the equation i wrote out for

    cos^2(x)=0.5*(1 +Sum[(-1)^n (2*x)^(2n)/(2n)!])

    assuming i set up all the variables correctly, does this seem right?
Working...