title: Move object around circle javascript
body: <p><img src="https://i.stack.imgur.com/qdyTO.png" alt="enter image description here"></p>
  
  <p>Above is just image to get a link for fiddle its role is nothing in question.</p>
  
  <p>I am trying to move an object along circle (actually a rectangular canvas with border-radius=100% so behaving as circle). But only able to move it and not able to resrict the movemment in the circle)</p>
  
  <p>Here is my <a href="http://jsfiddle.net/Qd8CB/1/" rel="nofollow noreferrer"><strong>JS Fiddle Link</strong></a>. <strong>Note:</strong> Please scroll down in js code and view the only code  written under following comments</p>
  
  <p><code>//---- Code of interest begins-----//</code> to //---code of interest ends---//</p>
  
  <p>My <strong>desired output</strong> will be like this wheel <a href="http://acko.net/blog/farbtastic-jquery-color-picker-plug-in/" rel="nofollow noreferrer">farbtastic</a>. Though it is open source yet i have been unable to use its mouse move event code in my colour wheel</p>
  
  <p>While trying to search I found <a href="https://stackoverflow.com/questions/17384663/canvas-move-object-in-circle">Canvas move object in circle</a>
  but I can not use it because i do not know <code>d</code> and do not know what is <code>across</code>. So unable to get theta with <code>arccos(1-(d/r)^2/2)</code></p>