Thread: ok need help with circle program

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    On an 80x25 display, you could start with
    char display[25][80];

    Fill it with spaces.

    Use the parametric form of
    x = cx + r * cos(theta)
    y = cy + r * sin(theta)

    You don't need many angles to get a complete circle on such a small display.

    When you're done, just loop and print the array.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  2. #2
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    Well, if I'm not mistaken, in my assignment on drawing circle a few yeras ago, you just need to draw a quarter of the circle's region. The other regions can be mirrored by the x=0, y=0 and x=y.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  2. circle problem
    By gunghomiller in forum C++ Programming
    Replies: 10
    Last Post: 07-14-2007, 06:40 PM
  3. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM