Author Topic: Ellipsen  (Read 3481 times)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10757
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Ellipsen
« on: 2005-Feb-18 »
So zeichnet man schnell gef├╝llte Ellipsen (auch unter PocketPC, wo POLYVECTOR nicht funktioniert).

Code: (glbasic) [Select]
// ------------------------------------------------------------- //
// -=#  ELLPISE  #=-
// ------------------------------------------------------------- //
FUNCTION Ellipse: x, y, w, h, col
LOCAL dy, xi
w=w/2
h=h/2
x=x+w
FOR dy = -h TO h
xi = w/h * SQR(h*h - dy*dy)
DRAWRECT x-xi, y+dy+h, xi+xi, 1, col
NEXT
ENDFUNCTION // ELLIPSE
« Last Edit: 2009-Sep-22 by Kitty Hello »