Volume of objects
These functions calculate the volume of common objects. Units follow the input: measurements in centimetres produce cubic centimetres. Divide cubic centimetres by 1000 to obtain litres.

The list of volume objects is somewhat shorter than the area list. Remember, you can often use area functions to calculate volume. If it is a hexagone-shaped rod, you can use the are of reg polygon and multiply by the length.
The first out, is a easy one. Volume of a box. Its simply multiply the sides in each direction. Anyway, for the completeness, I have made a function for it.
boxVolume(x; y; z )
Where
x= widthy= heightz= depth
Using the following formula:
Example:
boxVolume(10;15;20)=3000
*The next object is volume of a sphere. *
ballVolume(x )
Where
x= diameter (usually it is easier to obtain the diameter than the radius, so we made the formula with diameter)
Using the following formula:
Example:
ball with diameter of 20 cm, what is the volume?
ballVolume(20)=4188.790204 cm3
*The next object is volume of a cylinder: *
cylVolume(x; y )
Where
x= outer diametery= length
Using the following formula:
Example:
A cylinder, 10 cm diameter and 100 cm long:
cylVolume(10;100)=7853.981634
The next object is volume of a cone or truncated cone:
coneVolum(x; y; z )
Where
x= bottom diametery= top diameter (=0)z= height
Using the following formulas:
Here we have the first equation, that determines the height of the missing part in case of a truncated cone,
The next formula calculates the volume of the complete cone and subtracts the missing upper part. If the top diameter is zero, h and the subtracted volume are both zero.
Example:
Truncated cone, 15 cm base diameter, and 10 cm top diameter. The cone is 5 cm tick.
coneVolum(15;10;5)=621.773546 cm3
Another example: lets say, we have a truncated cone like the one above. Then we have a hole trough that is also cone-shaped. the bottom of the hole is 12 cm, and the top is 8 cm. The material is some kind of plastic that have a weight of 2g/cm3. How much is the weight of the whole thing ?
(coneVolum(15;10;5)-coneVolum(12;8;5))*2/1000=0.447677
Also 0,448 Kg.
The next function calculates the volume of a four-sided pyramid:
PyramidVolume(x; y; z )
Where
x= length of one side of basey= length of second side of basez= height from center of base to top
Using the following formula:
Example:
A pyramid has a 12 × 10 cm base and a height of 20 cm. What is its volume?
PyramidVolume(12;10;20)=800 cm3
The final function in the volume group is the ellipsoid. An ellipsoid resembles a sphere but may have a different diameter along each of its three axes.
elipsoidVolume(x; y; z )
Where
x= diameter x-planey= diameter y-planez= diameter z-plane
Using the following formula:
The general ellipsoid formula is 4/3*pi*a*b*c, where a, b, and c are its three semi-axes. Because this function takes diameters, the semi-axes are x/2, y/2, and z/2. Substitution simplifies the result to pi*x*y*z/6, as shown above.
Example:
An ellipsoid measures 10 × 15 × 10 cm. What is its volume?
elipsoidVolume(10;15;10)=785.398163 cm3
This completes the volume functions. Continue with the circumference formulas.
