Borland C++ reference

getarccoords

raw OCR

Gets coordinates of the last call to arc.

Defined in header <graphics.h>

Syntax

#include <graphics.h>
void far getarccoords(struct arccoordstype far *arccoords);

Portability

DOSUNIXWindowsANSI CC++ only
■

Remarks

getarccoords fills in the arccoordstype structure pointed to by arccoords with information about the last call to arc. The arccoordstype structure is defined in graphics.h as follows:

struct arccoordstype { int X, y; int xstart, ystart, xend, yend; }; The members of this structure are used to specify the center point ix,y), the starting position (xstart, ystart), and the ending position (xend, yend) of the arc. These values are useful if you need to make a line meet at the end of an arc.

Return value

None.

See also

Example

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)

   /* request autodetection */
   int gdriver = DETECT, gmode, errorcode;
   struct arccoordstype arcinfo;
   int midx, midy;
   int stangle = 45, endangle = 270;
   char sstr[80], estr[80];
   /* initialize graphics and local variables  */
   initgraph(&gdriver, igmode,  "");
   /* read result of initialization  */
   errorcode = graphresult ();
if (errorcode  != grOk) {  /* an error occurred */
   printf ("Graphics error: %s\n", grapherrormsg(errorcode)
   printf ("Press any key to halt:");
   getchO ;
   exit(l);                /* terminate with an error code */

midx = getmaxxO  / 2;
midy = getmaxyO  / 2;
/* draw arc and get coordinates  */
setcolor (getmaxcolor());
arc(midx, midy, stangle, endangle,  100);
getarccoords (&arcinfo);
/* convert arc information into  strings */
sprintf (sstr, "*- (%d, %d)", arcinfo.xstart, arcinfo.ystart)
sprintf (estr, "*- (%d, %d)", arcinfo.xend, arcinfo.yend);

/* output the arc information  */
outtextxy (arcinfo.xstart, arcinfo.ystart, sstr);
outtextxy (arcinfo.xend, arcinfo.yend, estr);

/* clean up */
getchO ;

closegraphO ;
return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.