[Oberon] Oberon-7 - Circle Segments

Jörg joerg.straube at iaeth.ch
Tue Feb 19 20:06:34 CET 2019


PROCEDURE HourTicks(r: INTEGER);
BEGIN
  s:= r DIV 2; c := r * 181 DIV 209;
  x[0] := 0; y[0] := r;
  x[1] := s; y[1] := c;
  x[2] := c; y[2] := s;
  x[3] := r; y[3] := 0;
  x[4] := c; y[4] := -s;
  x[5] := s; y[5] := -c;
  x[6] := 0; y[6] := -r;
  x[7] := -s; y[7] := -c;
  x[8] := -c; y[8] := -s;
  x[9] := -r; y[9] := 0;
  x[10] := -c; y[10] := s;
  x[11] := -s; y[11] := c;
END HourTicks

br
Jörg

> Am 19.02.2019 um 18:23 schrieb Tomas Kral <thomas.kral at email.cz>:
> 
> On Tue, 19 Feb 2019 18:08:54 +0100
> Tomas Kral <thomas.kral at email.cz> wrote:
> 
>> circle into 12
>> segments
> 
> Looking at V4 `ClockElem' I see this
> 
>  PROCEDURE Init;
>    VAR i: INTEGER;
>  BEGIN i := 0;
>    WHILE i < 60 DO
>      sin[i] := Math.sin(2 * Math.pi / 60 * i);
>      cos[i] := Math.cos(2 * Math.pi / 60 * i);
>      INC(i)
>    END
>  END Init;
> 
> I probably cannot do without trigonometry, right?
> 
> -- 
> Tomas Kral <thomas.kral at email.cz>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon



More information about the Oberon mailing list