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  

sin()

   
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+sin(a)*40.0); 
  a = a + inc; 
} 
Description   Calculates the sine of an angle. The sin() function expects the values of the angle parameter in radians (values between 0 and 6.28). Values are returned in the range -1 to 1.
   
Syntax  
sin(rad)
   
Parameters  
rad   float: an angle measured in radians (PI to -PI)

   
Returns   float
   
Usage   Web & Application
   
Related   cos()
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