cos


Description:

public double cos (double x)

Returns the cosine of x.

Note:

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

Example: Cosine (double):

public static int main (string[] args) {
// Output: ``cos (1.042310) = 0.504227``
double x = 1.04231;
double result = Math.cos (x);
print ("cos (%lf) = %lf\n", x, result);
return 0;
}

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

Parameters:

x

the given in radians.


Namespace: GLib.Math
Package: glib-2.0