Cos

Function Type:

The cos function operates on REAL or COMPLEX arguments only.

Function Purpose:

The cos function takes a REAL or COMPLEX argument ( an angle in radians ) and returns the value of cosine for that argument.

Required Arguments:

cos (x)

Where x is a REAL or COMPLEX argument that contains a value for an angle in radian form.

Optional Arguments:

There are no optional arguments.

Results:

To use this function, just do something similar to the following:

x = 60

pi = 3.1415926

x = x/180*pi ( remember, the angle must be in radians )

x = cos(x)

Naturally in this example the value of x will be 0.5. Please note that the variable that the function returns its value to does not have to be the same argument that was passed to it.

For more examples and information see:

lecture seven, and twenty nine

examples fall2.f, trapeziod.f

Up one level / Home


Written by Jason Wehr : jcw142@psu.edu and Maintained by John Mahaffy : jhm@cac.psu.edu