|
|
back to boardThe task is to find a volume of Piramid - volume of cylindr ? CAn you tell me the FORMULA? It is very easy))) double res = sqr(w)*h/3-h*pi*sqr(r)*(w-2*fabs((((y >= x && y >= -x) || (y < x && y < -x)) ? y : x)))/w; What procedure fabs does? abs (absolute value) for float. How can you solve it so easy? It is very easy))) double res = sqr(w)*h/3-h*pi*sqr(r)*(w-2*fabs((((y >= x && y >= -x) || (y < x && y < -x)) ? y : x)))/w; Why is minus? ..w-2*fabs.. |
|
|