functionatan2
Four quadrant inverse tangent (avoiding NAN)
Extends from Modelica.Math.baseIcon2.
Information
The equation y = atan2(u1,u2) computes y such that tan(y) = u1/u2 and
y is in the range -π < y ≤ π. Usually u1, u2 is provided in such a
form that u1 = sin(y) and u2 = cos(y).
If one of the two input values (either u1 or u2) is zero then the
call of atan2 is still possible.
However, if both input values are zero then atan2 returns an error.
The present implementation yields y = 0 if both input values are below
Modelica.Constants.eps.
Hence, the problem with the Modelica Standard Library atan2-call can be avoided.
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | u1 | 1 | Value of first axis |
| Real | u2 | 1 | Value of second axis |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.SIunits.Angle | y |