Stan Math Library
4.9.0
Automatic Differentiation
|
Returns the length of the hypotenuse of a right triangle with sides of the specified lengths (C99).
The partial derivatives are given by
\(\frac{\partial}{\partial x} \sqrt{x^2 + y^2} = \frac{x}{\sqrt{x^2 + y^2}}\), and
\(\frac{\partial}{\partial y} \sqrt{x^2 + y^2} = \frac{y}{\sqrt{x^2 + y^2}}\).
[in] | a | Length of first side. |
[in] | b | Length of second side. |