KNumXEqualsAtan2YZ

class KNumXEqualsAtan2YZ : public KConstraint

This class creates a X = atan2(Y, Z) constraint. Atan2(Y, Z) is defined as follow :

  • atan(Y/Z) if Z > 0

  • atan(Y/Z) + PI if Z < 0 and Y >= 0

  • atan(Y/Z) - PI if Z < 0 and Y < 0

  • (+ PI / 2) if Z = 0 and Y > 0

  • (- PI / 2) if Z = 0 and Y < 0

  • undefined if Z = 0 and Y = 0

Domain of X variable is at least (-PI, PI].

Example :

KFloatVar X(...);
KFloatVar Y(...);
KFloatVar Z(...);
// ...
problem.post(KNumXEqualsAtan2YZ(X, Y, Z));

See

KConstraint

Since

2020.1

Public Functions

KNumXEqualsAtan2YZ(const KNumVar &v1, const KNumVar &v2, const KNumVar &v3)

Primary constructor of X = atan2(Y, Z)

Parameters
  • v1 – the result variable

  • v2 – the first atan2 argument variable

  • v3 – the second atan2 argument variable

KNumXEqualsAtan2YZ(const KNumXEqualsAtan2YZ &toCopy)

Copy constructor.