Pythagoras

Determines the hypotenuse or leg of a right triangle

 Description The Pythagoras component computes the length of the third side of a right angle triangle. If parameter u1 is hypotenuse is false, then y is the length of the hypotenuse, otherwise ${u}_{1}$ is the length of the hypotenuse.
 Equations $\left\{\begin{array}{cc}\left\{\mathrm{valid}=\mathrm{true},{y}_{2}={u}_{1}^{2}+{u}_{2}^{2},y=\sqrt{{y}_{2}}\right\}& ¬\mathrm{u1 is hypotenuse}\\ \left\{{y}_{2}={u}_{1}^{2}-{u}_{2}^{2},\left\{\begin{array}{cc}\left\{\mathrm{valid}=\mathrm{true},\phantom{\rule[-0.0ex]{0.5ex}{0.0ex}}y=\sqrt{{y}_{2}}\right\}& 0\le {y}_{2}\\ \left\{\mathrm{valid}=\mathrm{false},y=0\right\}& \mathrm{otherwise}\end{array}\right\}\end{array}$

Connections

 Name Description Modelica ID ${u}_{1}$ Real input signal u1 ${u}_{2}$ Real input signal u2 $y$ Real output signal y $\mathrm{valid}$ Boolean output signal; true when y is a valid result valid

Parameters

 Name Default Units Description Modelica ID u1 is hypotenuse $\mathrm{false}$ If true, ${u}_{1}$ is the hypotenuse and y is one leg u1IsHypotenuse

 Modelica Standard Library The component described in this topic is from the Modelica Standard Library. To view the original documentation, which includes author and copyright information, click here.