I am not a mathematician but a simple programmer and came across a situation where I have to calculate different kinds of object volume. There is no specific type of object and i found that there are dozen of formulas to calculate volume like
- Cube $= a^3$
- Rectangular prism $= a b c$
- Irregular prism $= b h$
- Cylinder $= b h = π r^2 h$
- Pyramid $= \dfrac13 b h$
- Cone $= \dfrac13 b h = \dfrac13 π r^2 h$
- Sphere $= \dfrac43 π r^3$
- Ellipsoid $= \dfrac43 π r_1 r_2 r_3$
and maybe many more. But is there any general formula exists that can calculate the volume of any type of object?