D Documentation  
cos
real cos(real x)

Returns the cosinus of x (radians).

If x is ±INFINITY, the function returns -NAN.

Example:

//don't forget to import std.stdio and std.math :-)

writefln("cos(0)    is %f",cos(0));
writefln("cos(PI/2) is %f",cos(PI/2));
writefln("cos(PI/4) is %f",cos(PI/4));
writefln("cos(INF)  is %f",cos(float.infinity));
writefln("cos(-INF) is %f",cos(-float.infinity));

Output:
cos(0)    is 1.000000
cos(PI/2) is 0.000000
cos(PI/4) is 0.707107
cos(INF)  is -nan
cos(-INF) is -nan

See also:
std.math - Constants (PI)
Created using PHP docwiki written by Markus Dangl. Best viewed with Mozilla Firefox.