Results 1 to 5 of 5

Thread: Drawing a circle with Cos() and Sin()?

  1. #1

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    If I knew the centre point, the radius, and the point (in degrees 0-359) I wanted to draw, how would I draw it?

    (this should return X and Y, the point of the point... I hope I make sense!) I want to make a circle pixel by pixel so I need to know how to get the pixel!
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    http://www.sparkseek.com/cgi-bin/sea...&qry=bresenham

    http://www.gamedev.net/reference/art...article767.asp

    Try those links, they ought to explain a few things. It's a highly historical problem, drawing circles. Back when computers were incredibly slow by today's standards, it was a big deal drawing a circle. Thankfully it's pretty easy now
    Harry.

    "From one thing, know ten thousand things."

  3. #3

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Thats allright, I found it out...

    Here it is, for any curious ppl

    X = OriginX + cos(degree) * radius
    Y = OriginY + sin(degree)*radius
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Oh, well just drawing a circle like that is very inefficient and slow, but never mind. Sorry, I would have said that but I thought you'd want something fast.
    Harry.

    "From one thing, know ten thousand things."

  5. #5
    Lively Member TB's Avatar
    Join Date
    Feb 2001
    Location
    Austria
    Posts
    106

    Exclamation

    When you use Visual Basic to draw a circle with this code you will have to convert the degrees into radiant,
    i mean you will have to multiply the degree value with PI/180 before you use it.
    mojo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width