# DrawingAPI an ellipse

**URL:** <https://forum.kirupa.com/t/drawingapi-an-ellipse/148199>\
**Category:** Uncategorized\
**Created:** [May 17, 2005, 10:24pm UTC](https://forum.kirupa.com/t/drawingapi-an-ellipse/148199 "2005-05-17T22:24:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gafitescu](https://avatars.discourse-cdn.com/v4/letter/g/8e7dd6/32.png) [@gafitescu](https://forum.kirupa.com/u/gafitescu)\
**Post date:** [May 17, 2005, 10:24pm UTC](https://forum.kirupa.com/t/drawingapi-an-ellipse/148199/1 "2005-05-17T22:24:39Z")

</div>

[color=black]\*\*I want to draw a ellipse using a function that looks like this :

```auto
function crearecerc(mcClip:MovieClip)
{
     nRadius=parseInt(raza.text);
     nX=parseInt(corx.text)+X;
     nY=parseInt(cory.text)+Y;
     mcClip.beginFill(parseInt(culoare_t.text, 16),100);
     mcClip.lineStyle(1,parseInt(culoare_t.text, 16), 100);
    var nAngleDelta:Number = Math.PI / 4;
    var nCtrlPoint:Number = nRadius/Math.cos(nAngleDelta/2);
    var nAngle:Number = 0;
    var nRx:Number = 0;
    var nRy:Number = 0;
    var nAx:Number = 0;
    var nAy:Number = 0;
    mcClip.moveTo(nX + nRadius, nY);
    for (var i:Number = 0; i < 8; i++) {
      nAngle += nAngleDelta;
      nRx = nX + Math.cos(nAngle-(nAngleDelta/2))*(nCtrlPoint);
      nRy = nY + Math.sin(nAngle-(nAngleDelta/2))*(nCtrlPoint);
      nAx = nX + Math.cos(nAngle)*nRadius;
      nAy = nY + Math.sin(nAngle)*nRadius;
      mcClip.curveTo(nRx, nRy, nAx, nAy);
    }
     mcClip.endFill();
}

```

This function creates a circle but I want to create an ellipse knowing just the center , right distance and down distance like in this figure :  
[figure](http://www.gafitescu.as.ro/ellipse.gif)  
mcClip is the movie clip .  
the center and the distances I take from a input text.\*\*[/color]
