title: Get mouse position relative to pie chart (equation)
body: <p>I have created a canvas pie chart from an array of data, I am now trying to locate the mouse position relative to the pie chart to detect which section of data is being hovered. I am almost there but I am stuck on an equation.</p>
  
  <p>My logic is functioning fine so I think this is more of a Maths question but will see what others think of my approach. here is my pie chart and the variables I am using:</p>
  
  <p><img src="https://i.stack.imgur.com/oJKvR.jpg" alt="Pie chart example"></p>
  
  <p>The listed variables on the image are the variables that I have to use (mouseX, mouseY, distance from center, radius, circumfrence in pi and the section of data's point on the circumference relative to pi).</p>
  
  <p>The starting section of the chart is from the right and starts at 0 of pi*2 to 100% of pi*2, the grey section then has a starting position of 1.34... relative to pie*2 and an end position of 2.228...</p>
  
  <p>My main issue currently is using a pixel measurement to calculate it's position relative to pi. I could possibly check the position from top and left then work out the distance from center and work out the line from center depending on pi but I'm stumped on calculating this.</p>