[Jaffa Software]

Drawing circles with DrawWEM

Victor Markwart, 31-Jan-1999

Date: Sun, 31 Jan 1999 16:33:46 +1100
From: Victor Markwart <markwart@pcug.xxx.xxx>
To: wwv2@jaffasoft.co.uk
Subject: Circles

Hi, For those who might like to know how, you can draw a circle using DrawWEM using the following procedure:


DEF PROCdraw_circle(x, y, r)
  LOCAL v
  v = .55 * r
  DRAW_MOVE(x, y + r)
  DRAW_CURVE(x + r, y, x + v, y + r, x + r, y + v)
  DRAW_CURVE(x, y - r, x + r, y - v, x + v, y - r)
  DRAW_CURVE(x - r, y, x - v, y - r, x - r, y - v)
  DRAW_CURVE(x, y + r, x - r, y + v, x - v, y + r)
ENDPROC

x and y are the centre of the circle, r is the radius.

Cheers
Victor

< WimpWorks