**Public Function RightTriangleCalc( _
Optional ByVal vArea As Variant _
, Optional ByVal vBase As Variant _
, Optional ByVal vDiagonal As Variant _
, Optional ByVal vHeight As Variant _
, Optional ByVal vPerimeter As Variant _
) As Variant**

**"Right Triangle Calculator" **

Calculate some property about right triangles given the value of two other properties.

**Examples:** RightTriangleCalc(vArea:=10, vBase:=4, vPerimeter:="CALC") = 15.4031242374328
RightTriangleCalc(10, 4, Null, Null, "CALC") = 15.4031242374328
RightTriangleCalc(10, Null, 12, "CALC", Null) = 11.8813494967181
RightTriangleCalc(Null, 3, 30, Null, "CALC") = 62.8496231131986
RightTriangleCalc(Null, "CALC", 10, 23, Null) = "0|20.712315177208"

**See also:** RectangleCalc Function

**Summary:** Two 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 arguments 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".

**vArea:** Area of the right triangle.

**vBase:** Length of the base of the right triangle.

**Note:** When the base is to be calculated and the height is unknown, the base is considered to be the shorter of the two sides. When both the base and height are known values supplied to this function, either one can be smaller than the other.

**vDiagonal:** Length of the diagonal line.

**vHeight:** Height of the right triangle.

**Note:** When the height is to be calculated and the base is unknown, the height is considered to be the longer of the two sides. When both the height and base are known values supplied to this function, either one can be smaller than the other.

**vPerimeter:** Perimeter around the outside of the right triangle.

**Note:** This function does not accept all combinations of two known properties; see the detailed notes below.

**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. **Note:** Cannot currently calculate the Height from the Base and Perimeter.

**Note:** Cannot currently calculate the Base from the Height and Perimeter.

**Note:** Cannot currently calculate the Base and Height from the Area and Perimeter.

**Note:** Cannot currently calculate the Base and Height from the Diagonal and Perimeter.

Copyright 1996-1999 Entisoft

Entisoft Tools is a trademark of Entisoft.