-
Notifications
You must be signed in to change notification settings - Fork 1
Tristan Hume edited this page Apr 23, 2012
·
2 revisions
#cos
##Syntax cos (r : real) : real
##Description The cos function is used to find the cosine of an angle given in radians. For example, cos (0) is 1.
##Example This program prints out the cosine of p/6, 2p/6, 3p/6, up to 12p/6 radians.
const pi := 3.14159
for i : 1 .. 12
const angle := i * pi / 6
put "Cos of ", angle, " is ", cos (angle)
end for
##See also the sin.html and tan.html functions for calculating sine and tangent.
the cosd.html function which finds the cosine of an angle given in degrees. (2p radians are the same as 360 degrees.)
See also predefined unit mathmodule.html.