atan2f


Description:

public float atan2f (float y, float x)

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

Note:

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

The GLib.Math.atan2f function calculates the arc tangent of the two variables x and y.

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 (float):

public static int main (string[] args) {
// Output: ``atan2f (10.000000f, 5.000000f) = 1.107149f``
float x = 10.0f;
float y = 05.0f;
float result = Math.atan2f (x, y);
print("atan2f (%lff, %lff) = %lff\n", x, y, result);
return 0;
}

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


Namespace: GLib.Math
Package: glib-2.0