Bitmap/Midpoint circle algorithm: Difference between revisions

(Add J)
(→‎{{header|J}}: simplify)
Line 393:
if. f >: 0 do.
y=. <:y
f=. f + _2&* y NB. _2 * y
end.
x=. >:x
f =. f + 2&(>:@*) x NB. 1 + 2 * x
end.
offsets=. (,|."1) (1 _1 {~ #: i.4) *"1"1 _ pts
Line 411:
myimg=: (12 12 12 ; 255 0 0) drawCircle myimg NB. draw red circle with radius 12
viewRGB ((12 12 9 ,: 12 12 6) ; 0 0 255) drawCircle myimg NB. draw two more concentric circles
</lang>
 
'+' (<"1 getBresenhamCircle 7 7 7)} 15 15$ ' '
+++++
++ ++
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
++ ++
+++++ </lang>
 
=={{header|Modula-3}}==
892

edits