_scienceMathsVolumeSphere
Retrieve the volume of sphere.
Prototype :
fun [F F I] F
- F : the radius. Can be nil, see flag below.
- F : the height. Can be nil, see flag below.
- I : a flag : get the volume as :
- SCOLMATHS_VOLUME_SPHERE : the volume of the full (entire) sphere. The
height will be ignored, so, it can be nil. The radius
must be defined.
- SCOLMATHS_VOLUME_SPHERICAL_CAP : a spherical cap. The height
is the height of the spherical cap, the radius is its ... radius !
- SCOLMATHS_VOLUME_SPHERE_CONE_INTERSECT : the volume of the sphere
pierced by a cylinder (napkin ring). The height must be defined,
the radius will be ignored, so it can be nil.
- SCOLMATHS_VOLUME_SPHERE_CYLINDER : intersection between a cone and
a sphere. The top of the cone is the center of the sphere. The radius
is the radius of the sphere, the height is the height of the cone.
- other value : return nil.
Return : F the volume or nil if error
See also :
Example :
Differents volumes with a radius is at 1.0 and an height is at 2.0. With these
values, all volumes are the same.
fun main ()=
_showconsole;
_fooF _scienceMathsVolumeSphere 1.0 nil SCOLMATHS_VOLUME_SPHERE; // 4.188790
_fooF _scienceMathsVolumeSphere 1.0 2.0 SCOLMATHS_VOLUME_SPHERICAL_CAP; // 4.188790
_fooF _scienceMathsVolumeSphere nil 2.0 SCOLMATHS_VOLUME_SPHERE_CONE_INTERSECT; // 4.188790
_fooF _scienceMathsVolumeSphere 1.0 2.0 SCOLMATHS_VOLUME_SPHERE_CYLINDER; // 4.188790
0;;
Note