Function Math Geometry Class

RectangularSolidCalc

"Rectangular Solid Calculator" Calculate some property about rectangular solids given the value of THREE other properties.

Signature (Visual Basic / VBA)

Public Function RectangularSolidCalc( _
      Optional ByVal vArea As Variant _
    , Optional ByVal vSideOne As Variant _
    , Optional ByVal vSideTwo As Variant _
    , Optional ByVal vSideThree As Variant _
    , Optional ByVal vVolume As Variant _
    ) As Variant

Code Example

    RectangularSolidCalc(vSideOne:=1, vSideTwo:=2, vVolume:=10, vArea:="CALC") = 34
    RectangularSolidCalc("CALC", 1, 2, Null, 10) = 34
    RectangularSolidCalc(100, 2, "CALC", Null, 34) = 1.10419703602177
    RectangularSolidCalc(100, 12, "CALC", Null, 200) = "1.38888888888889|-3.83896526696812" ' #4

Parameters

Parameter Description
vArea Area of the rectangular solid.
vSideOne Length of one of the sides of the rectangular solid.
vSideTwo Length of another of the sides of the rectangular solid.
vSideThree Length of another of the sides of the rectangular solid.
vVolume Volume of the rectangular solid.

Notes & Version History

Summary Three of the arguments should contain a numeric value--the given values for those properties. Pass the word "CALC" to the argument whose value is to be calculated and returned by this function. The other argument should be missing or Null or non-numeric. Function returns Null if it could not calculate the requested property from the values provided. Otherwise, the function returns the value of the property whose argument was passed the word "CALC".
Note Function may return a complex number in the form of a string if the given dimensions are not consistent with the shape, as in example #4.
Note The match on the word "CALC" is case-insensitive, so for example, "CALC" and "Calc" match each other.