title: How to slow down the frequency of a sin() wave in GLSL?
body: <p><em>Question Reference:</em></p>
  
  <p><strong><a href="http://thebookofshaders.com/03/" rel="nofollow noreferrer">http://thebookofshaders.com/03/</a></strong></p>
  
  <pre><code>#ifdef GL_ES
  precision mediump float;
  #endif
  
  uniform float u_time;
  
  void main() {
      gl_FragColor = vec4(abs(sin(u_time)),0.0,0.0,1.0);
  }
  </code></pre>
  
  <h2><a href="http://thebookofshaders.com/edit.php?log=170209043856" rel="nofollow noreferrer">Live Code Example</a></h2>
  
  <blockquote>
    <p>Now it is time again to play with the above code.</p>
    
    <p>1 -  Slow down the frequency until the color change becomes almost imperceptible.</p>
    
    <p>2 - Speed it up until you see a single color without flickering.</p>
    
    <p>3 - Play with the three channels (RGB) in different frequencies to get interesting patterns and behaviors.</p>
  </blockquote>
  
  <p>For the first ask:</p>
  
  <blockquote>
    <p>1 -  Slow down the frequency until the color change becomes almost
    imperceptible.</p>
  </blockquote>
  
  <p>I tried dividing/multiplying the <code>u_time</code> which yielded a syntax error. <code>uniform float u_time/2; // ERROR</code>, I'm just having difficultly understanding what the author wants me to learn.  I'm feeling hard pressed to move forward in the readings w/o understanding.</p>
  
  <p>Maybe the author's questions wants me to not use <code>abs(sin(u_time))</code> but rather another function:</p>
  
  <blockquote>
    <p>The GPU has hardware accelerated angle, trigonometric and exponential functions.</p>
    
    <p>Some of those functions are: sin(), cos(), tan(), asin(), acos(),
    atan(), pow(), exp(), log(), sqrt(), abs(), sign(), floor(), ceil(),
    fract(), mod(), min(), max() and clamp().</p>
  </blockquote>
  
  <p>If so, which function would I use to complete the asks stated below?</p>
  
  <p><em>Could I also get help understanding how to solve: 2 and 3</em></p>
  
  <blockquote>
    <p>2 - Speed it up until you see a single color without flickering.</p>
    
    <p>3 - Play with the three channels (RGB) in different frequencies to get
    interesting patterns and behaviors.</p>
  </blockquote>