In this program i am trying to find the perimeter of an ellipse and even when I try switching one number I still get the same answer. I know it is not correct because i solved it on my calculator and cannot seem to get the correct answer.. can someone help me please? This is what my program looks like and what is bold is where I seem to be having trouble. The equation i have for a half an ellipse is π√a2+√b2÷2 (The square root goes over a2+b2 [2's are squared]). I believe the correct answer to the perimeter of the figure in this whole program is 62.3833.
(A_Trig+A_Rect+A_Ellipse+A_Circle+A_Par);
cout<<"The total area of the figure is="<<Area<<endl;
output<<"The total area of the figure is="<<Area<<endl;
(P_Trig+P_Ellipse+P_Circle+P_Par+f);
cout<<"The total perimeter of the figure is="<<Perimeter<<endl;
output<<"The total perimeter of the figure is="<<Perimeter<<endl;
system("PAUSE");
return 0;
}
i figured it out thanks tho. All i was doing wrong was that i forgot to add an additional pow() command for the square root. Silly mistake.
and i was using the same formula shown above. I got it from http://www.mathsisfun.com/geometry/ellipse-perimeter.html , but that is for a full ellipse so I removed the 2 in front of the equation making it so it was for half an ellipse opposed to a full ellipse.