Areas
Public Function AreaCircle(Radius As Double) As Double
Return Math.PI * Radius * Radius
End Function
'
Public Function AreaEllipse(rMin As Double, rMax As Double) As Double
Return Math.PI * rMin * rMax
End Function
'
Public Function AreaRectangle(w As Double, h As Double) As Double
Return w * h
End Function
'
Public Function AreaRhombus(w As Double, h As Double) As Double
Return 0.5 * w * h
End Function
'
Public Function AreaTriangle(base As Double, height As Double) As Double
Return 0.5 * base * height
End Function
'
Public Function TriangleArea2(ByVal a As Double, ByVal b As Double, ByVal c As Double) As Double
Dim s As Double = (a + b + c) / 2
Return Math.Sqrt(s * (s - a) * (s - b) * (s - c))
End Function
Volumes
Public Function VolumeCone(radius As Double, high As Double) As Double
Return radius * radius * high / 3
End Function
'
Public Function VolumeCube(w As Double, h As Double, d As Double) As Double
Return w * h * d
End Function
'
Public Function VolumeCylinder(r As Double, h As Double) As Double
Return Math.PI * r * r * h
End Function
'
Public Function VolumeSphere(radius As Double) As Double
Return Math.PI * Math.Pow(radius, 3)
End Function
Circumference
Public Function CircumferenceCircle(radius As Double) As Double
Return 2 * Math.PI * radius
End Function
DigitalDan.co.uk