|
|
researchv10 Dan Cross
.ds ZZ DEVELOPMENT PACKAGE
.TH JCIRCLE 3L "630 MTG"
.XE "jcircle()"
.XE "jdisc()"
.XE "jarc()"
.SH NAME
jcircle, jdisc, jarc \- draw circle on display
.SH SYNOPSIS
.B #include <dmd.h>
.sp
.B void jcircle (p, r, f)
.PP
.B void jdisc (p, r, f)
.PP
.B void jarc (p, p1, p2, f)
.PP
.B Point p, p1, p2;
.br
.B int r;
.br
.B Code f;
.SH DESCRIPTION
The
.I jcircle
function
draws
the approximate circle of radius
.I r
centered at
.I p
with Code
.IR f
in the
display bitmap.
.PP
The
.I jdisc
function
draws a disc of radius
.I r
centered at
.I p
with Code
.IR f
in the
display bitmap.
.PP
The
.I jarc
function
draws the circular arc centered at
.I p
counterclockwise from
.I p1
to the point on the circle closest to
.I p2
with Code
.IR f
in the
display bitmap.
.PP
All coordinates and radii are in window coordinates.
Because the window is scaled,
these routines are actually implemented by calls to the ellipse routines.
.SH EXAMPLE
The following routine draws a row of eight circles,
a row of eight discs, and a row of eight arcs, scaled
to the shape of the window.
.PP
.RS 3
.ft CM
.nf
#include <dmd.h>
draw()
{
Point p;
int i, r;
r = 50;
p.y = 200;
for (p.x=100; p.x < XMAX-50; p.x+=120)
jcircle (p, r, F_XOR);
p.y = 600;
for (p.x=100; p.x < XMAX-50; p.x+=120)
jdisc (p, r, F_XOR);
p.y = 900;
for (p.x=100; p.x < XMAX-50; p.x+=120)
jarc (p, Pt(p.x-r, p.y), Pt(p.x+r,
p.y), F_XOR);
request(KBD);
wait(KBD);
}
.fi
.ft R
.RE
.SH SEE ALSO
circle(3L), ellipse(3L), globals(3R), jellipse(3L),
structures(3R), transform(3R/3L).
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.