ELLIPSE(3L)

NAME
ellipse, eldisc, eldiscture, elarc - draw an ellipse

SYNOPSIS
#include <dmd.h>

void ellipse (bp, p, a, b, f)

void eldisc (bp, p, a, b, f)

void eldiscture (bp, p, a, b, t, f)

void elarc (bp, p, a, b, p1, p2, f)

Bitmap *bp;
Point p, p1, p2;
int a, b;
Texture16 *t;
Code f;

DESCRIPTION
The ellipse function draws an ellipse centered at p with horizontal semi-axis a and vertical semi-axis b in Bitmap bp with Code f.

The eldisc function draws an elliptical disc centered at p with horizontal semi-axis a and vertical semi-axis b in Bitmap bp with Code f.

The eldiscture function draws an elliptical disc centered at p with horizontal semi-axis a and vertical semi-axis b in Bitmap bp using Texture16 t with Code f.

The elarc function draws the corresponding elliptical arc, traveling counterclockwise from the ellipse point closest to p1 to the point closest to p2. Note: Differences exist between the calling conventions for arc and elarc.

EXAMPLE
The following routine can be used to allow a user to sweep out an ellipse by holding button 1 down. When button 1 is released, the ellipse is filled using the elliptical disc routine.

    #include <dmd.h>
    main()
    {
    	sweep_eldisc();
    	request(KBD);
    	wait(KBD);
    }

    sweep_eldisc()
    {
       Point p, c;
       int a, b;
       request(MOUSE);
       while (!button1() )
          wait (MOUSE);
       c = p = mouse.xy;
       while (button1())
          if (!eqpt(p, mouse.xy)){
             if( !eqpt( p, c))  /* undraw old ellipse */
                ellipse (&display, c, a, b, F_XOR);
             p = mouse.xy;
             a = abs (p.x - c.x);
             b = abs (p.y - c.y);
             ellipse (&display, c, a, b, F_XOR);
          }
       ellipse (&display, c, a, b, F_XOR);
       eldisc  (&display, c, a, b, F_XOR);
    }

SEE ALSO
circle(3L), jcircle(3L), jellipse(3L).