[Oberon] FPGA - Display3.Mod - porting

Tomas Kral thomas.kral at email.cz
Tue Nov 20 18:32:54 CET 2018

On Thu, 8 Nov 2018 23:27:46 +0100
Jörg Straube <joerg.straube at iaeth.ch> wrote:

> For a circle only one octant (iso one quarter) has to be computed.
> The 7 other octants are symmetry :-)

Yes, clever.

EDIT, this is fun, see attached.

As my math is very poor, I still wonder how this algo could be
parameterised to draw any Arc. Doing this, just draws an Arc, a quarter
circle North-East. Reading more suggested tech notes.

  PROCEDURE Arc*(col, x0, y0, r: INTEGER);
    VAR x, y, u: INTEGER;
  BEGIN u := 1 - r; x := r; y := 0;
    WHILE y <= x DO
      D.Dot(col, x0+x, y0+y, D.replace);
      D.Dot(col, x0+y, y0+x, D.replace);
      IF u < 0 THEN INC(u, 2*y+3) ELSE INC(u, 2*(y-x)+5); DEC(x) END ;
  END Arc;

Tomas Kral <thomas.kral at email.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rgb.png
Type: image/png
Size: 32607 bytes
Desc: not available
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20181120/3df158bc/attachment.png>

More information about the Oberon mailing list