kcl library referencestdmathlegLen

legLenFunction in std::math

Compute the length of the given leg.

legLen(
  hypotenuse: number,
  leg: number,
): number

Arguments

NameTypeDescriptionRequired
hypotenusenumberThe length of the triangle's hypotenuseYes
legnumberThe length of one of the triangle's legs (i.e. non-hypotenuse side)Yes

Returns

number - A number

Examples

legLen(hypotenuse = 5, leg = 3)