title: Draw a line from a point to opposite tangents on a circle? Cone/wedge shape in AS3
body: <p>This should be a bit of simple geometry: How do I calculate the points to draw the lines in the code below so that it makes a 2D cone or wedge shape?</p>
  
  <pre><code>import flash.geom.Point;
  
  //draw circle
  var mc=new Sprite()
  mc.graphics.lineStyle(0,0)
  mc.graphics.drawCircle(0,0,30)
  mc.x=mc.y=Math.random()*300+100
  addChild(mc)
  
  //draw lines:
  graphics.lineStyle(0,0)
  var p=new Point(Math.random()*500,Math.random()*400)
  graphics.moveTo(p.x, p.y)
  graphics.lineTo(mc.x,mc.y) // &lt;&lt; should be point on edge of circle
  graphics.moveTo(p.x, p.y)
  graphics.lineTo(mc.x,mc.y) // &lt;&lt; should be point on opposite edge of circle
  </code></pre>
  
  <p>UPDATE:<br>
  Thanks guys, I should have mentioned my aim is not to draw a wedge shape, but to draw a line from a random point to the edge of an existing circle.</p>
  
  <p>If you're more comfortable with algebra than actionscript, maybe you could have a look at this graphic and post a formula for me?
  <img src="https://i.stack.imgur.com/puv7E.png" alt="tangents"></p>