by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 5.1, Creation date: 2021-11-26, Last change: 2025-09-15
See Also: V2A
[V,W,M]=VofRsphere([R,M])
R: | Radius [r h]; default is [r r] | |
M: | Material such as 'Fe', 'Pb', 'Si' |
V: | Volume | |
W: | Weight | |
M: | Material |
VofRsphere(5,'Pb'); % Lead sphere with 10mm diameter
This function calculates the volume and weight of a sphere made of a specified material. It is designed to assist in creating ballast using lead or steel balls.
R from the input parameters. If R is a single value, set it to [R, R]. Assign H as the second element of R and R as the first element.M from the input parameters. Default is 'Fe'.Tab with materials and their densities: 'Fe' (7.8352), 'Pb' (11.3), 'Si' (2.33), 'Holz' (0.755), 'Papier' (0.755).M is a string, find the corresponding density sw from the table. If M is not a string, use M as the density.V of the sphere using the formula V = 4.1888 * R * R * H (approximating 4/3 * pi).Q of a block with the same dimensions using Q = 8 * R * R * H.W of the sphere using W = V * sw / 1000.To calculate the volume and weight of a lead sphere with a 10mm diameter, use:
VofRsphere(5, 'Pb');Algorithm explaination created using ChatGPT on 2025-08-19 06:46. (Please note: No guarantee for the correctness of this explanation)