Author Topic: Ellipses  (Read 3003 times)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10758
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Ellipses
« on: 2005-Feb-18 »
If you want to fill ellipses on PocketPC, where the POLYVECTOR does not work, try this:
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 »