title: Plot from Cartesian to polar
body: <p>I'm using the Left and Right audio channels to create a Lissajous Vectorscope.  Left is x and Right is y, both which never goes beyond 1 and -1 values. These coordinates are also shifted at a 45 degree angle to give me the following view.</p>
  
  <p><a href="https://i.stack.imgur.com/fm9wn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fm9wn.png" alt="enter image description here"></a> </p>
  
  <p>So I'm doing a very simple </p>
  
  <pre><code>// converting x and y value from (-1 - 1) to (0 - 1)
  float x = LeftChannelValue/2 + 0.5
  float y = RightChannelValue/2 + 0.5
  
  // multiplying the width and height with X and Y to get a proper square
  // width and height have to be the same value 
  float new_X = x*(width*0.5)
  float new_Y = y*(height*0.5)
  
  // doing two dimensional rotating to 45 degrees so it's easier to read
  float cosVal = cos(0.25*pi)
  float sinVal = sin(0.25*pi)
  
  float finalX = (((new_X*cosVal)-(new_Y *sinVal))) + (width*0.5) //adding to translate back to origin 
  float finalY = ((new_X*sinVal) + (new_Y *cosVal)) 
  </code></pre>
  
  <p>This gives me the results on that picture. </p>
  
  <p>How would I graph the polar coordinates so that it doesn't look like a square, it looks like a circle?
  <a href="https://i.stack.imgur.com/wDohy.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wDohy.gif" alt="enter image description here"></a>
  I'm trying to get this view but am absolutely confused about how that would correlate with the left and right. I'm using <a href="https://en.wikipedia.org/wiki/Polar_coordinate_system" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Polar_coordinate_system</a> as a reference. </p>