atan2


Description:

public double atan2 (double y, double x)

Calculates the arc tangent of the two variables x and y.

Note:

Remember to link the math library: valac -X -lm ...

It is similar to calculating the arc tangent of y / x, except that the signs of both arguments are used to determine the quadrant of the result.

Example: Arc tangent of y/x (double):

public static int main (string[] args) {
// Output: ``atan2 (30.000000, 20.000000) = 0.982794``
double x = 30.0;
double y = 20.0;
double result = Math.atan2 (x, y);
print("atan2 (%lf, %lf) = %lf\n", x, y, result);
return 0;
}

valac --pkg glib-2.0 -X -lm GLib.Math.atan2.vala


Namespace: GLib.Math
Package: glib-2.0