title: Sine square in python
body: <p>Need help. How I can get sine square in python? Is there specific method or function?</p>
  
  <p><a href="https://i.stack.imgur.com/ThRP3.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ThRP3.gif" alt="enter image description here"></a></p>
  
  <p>Some supposedly obvious solutions are NOT suitable. Examples:</p>
  
  <pre><code>import numpy as np
  import math
  
  
  x = np.arange(0, 3, 0.5)
  print([(math.sin(i) ** 2) for i in x])
  print([math.sin(math.sin(i))for i in x])
  # [0.0, 0.22984884706593015, 0.7080734182735712, 0.9949962483002227, 0.826821810431806, 0.3581689072683868]
  #[0.0, 0.4612695550331807, 0.7456241416655579, 0.8401148815567654, 0.7890723435728884, 0.5633808209655248]
  
  # or
  
  x = np.arange(0, 3, 0.5)
  print(np.sin(x) ** 2)
  print(np.sin(np.sin(x)))
  # [0.         0.22984885 0.70807342 0.99499625 0.82682181 0.35816891]
  # [0.         0.46126956 0.74562414 0.84011488 0.78907234 0.56338082]
  </code></pre>