Convert Volume to Surface Area in Visual Basic


Here's a simple VB function that i have included to demonstrate the conversion of amount volume to the surface area of the sphere container.

How to use this function :
For instance, we want to convert the VOLUME of 4000 cm3 (about a gallon) of a sphere to its SURFACE AREA, we can use the function below to access its formula.
For Example :
SurfaceArea = VolumeToSurfaceArea( 4000 )
SurfaceArea = 1218.75

Hence the surface area is 1218.75 cm2



Private Function VolumeToSurfaceArea(ByVal Volume As Double) As Double

' Sphere Volume to Surface Area
Dim R As Double
R = ((Volume * (3 / 4) * (7 / 22)) ^ (1 / 3))
Return (4 * (22 / 7) * R * R)

End Function



Back to VB Egg

0 comments