Geez, people.
area = PI*(d_gasket*d_gasket-d_hole*d_hole)/4.0
is the correct formula as long as the #define for PI is corrected.
Printable View
Geez, people.
area = PI*(d_gasket*d_gasket-d_hole*d_hole)/4.0
is the correct formula as long as the #define for PI is corrected.
It may be the correct mathamatical formula but it may not code in C as you would do it by hand.
The sequence plays left to right... but in computer space you need some things done before others for it to make any sense...
area = (PI * ((d_gasket * d_gasket) - (d_hole * d_hole) )) / 4;
It's about the C language "Order of Evaluation" rules.