title: How to calculate Arc length dependently of start angle?
body: <p>I am building a road editor where one can drag predefined road segments together and combine them to a connected road. One of those segments is a right curve. 
  <a href="https://i.stack.imgur.com/rK7ZM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rK7ZM.png" alt="enter image description here"></a></p>
  
  <p>The curve is drawn as SVG (using D3 arc path function) and has two handles to change the radius and the length directly within the SVG (small black circle changes length and small black square changes the radius). I use a d3 drag handler on the handles.</p>
  
  <p>To calculate the new central angle I do as follows:</p>
  
  <ol>
  <li>get YOffset from center point of the arc</li>
  <li>flip YOffset (to match screen y and math) </li>
  <li>get corresponding x value with Pythagoras (x = Math.sqrt(r^2 - YOffset^2))</li>
  <li>get the respective central angle (Math.PI / 2 - Math.atan2(YOffset, x);</li>
  </ol>
  
  <p>This will only work if the arc starts at PI/2 like in the figure. If I add further arcs with arbitrary start angles (see next figure, red arc), my solution wont work. </p>
  
  <p><a href="https://i.stack.imgur.com/SzZn6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SzZn6.png" alt="enter image description here"></a></p>
  
  <p>I'm looking for a general solution so it will work for any arc regardless of its start angle.</p>