Language \ Environment \ Comparison
 
Index
 
  The Processing 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: reas at groupc.net
Name  

cos()

   
Examples  
float a = 0.0; 
float inc = TWO_PI/25.0; 
 
for(int i=0; i<100; i=i+4) { 
  line(i, 50, i, 50+cos(a)*40.0); 
  a = a + inc; 
} 
Description   Calculates the cosine of an angle. The cos() function expects the values of the angle parameter to be provided in radians (values between 0 and 6.28). Values are returned in the range -1 to 1.
   
Syntax  
cos(angle)
   
Parameters  
angle   float: an angle measured in radians (PI to -PI)

   
Returns   the cosine (a value from -1.0 to 1.0) of the angle specified by the parameter angle
   
Usage   Web & Application
   
Related   sin()
tan()
atan2()
radians()
   
© 2004 - 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea
Processing is an open project initiated by Ben Fry and Casey Reas