Results 1 to 4 of 4

Math Help - Integer based circle equation

  1. #1
    Newbie
    Joined
    Jul 2012
    From
    UAE
    Posts
    3

    Integer based circle equation

    Hi I am wondering if it is possible to get an integer based function for a circle. I tried using the y = Square Root(r^2 - x^2) function and rounding off the y values but that just gives me a broken circle. The reason I need an integer based result is that im plotting this into a matrix array and not a Cartesian graph so I just need a rough representation of a circle. There are programming algorithms to do this like Bresenham's Circle Algorithm but just wondering if it's possible using the original circle equation.

    Thanks,
    satusjin.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    earboth's Avatar
    Joined
    Jan 2006
    From
    Germany
    Posts
    5,829
    Thanks
    123

    Re: Integer based circle equation

    Quote Originally Posted by satsujin View Post
    Hi I am wondering if it is possible to get an integer based function for a circle. I tried using the y = Square Root(r^2 - x^2) function and rounding off the y values but that just gives me a broken circle. The reason I need an integer based result is that im plotting this into a matrix array and not a Cartesian graph so I just need a rough representation of a circle. There are programming algorithms to do this like Bresenham's Circle Algorithm but just wondering if it's possible using the original circle equation.

    Thanks,
    satusjin.
    Have a look here: Pythagorean triple - Wikipedia, the free encyclopedia
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jul 2012
    From
    UAE
    Posts
    3

    Re: Integer based circle equation

    Sorry, my bad. I was only looking at one quadrant of the circle. Once I added in all the quadrants the broken areas of the first quadrant were filled in. However, there is significant overlap in the points. Any formula that doesn't regenerate the same points again? I am current getting y using the circle equation, incrementing x by 1 until i get the radius and based on the x,y values i get generating quadrants by combining all the possible values of +x,+y,-x,-y. So, for a radius r, that's r*8 x,y pairs.
    Last edited by satsujin; July 8th 2012 at 02:17 AM.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Jul 2012
    From
    UAE
    Posts
    3

    Re: Integer based circle equation

    Quote Originally Posted by earboth View Post
    Thanks, earboth. I'll give that a deeper looksee, but I suspect it's above my primitive math level. I also suspect multiple square roots to solve a triple for x and y values which is something I'm trying to avoid.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 7
    Last Post: December 9th 2011, 11:29 PM
  2. Replies: 4
    Last Post: October 25th 2010, 08:03 AM
  3. Generate an equation based on another one?
    Posted in the Algebra Forum
    Replies: 1
    Last Post: November 17th 2009, 03:44 AM
  4. Equation set based on the Fibinocci Sequence
    Posted in the Math Topics Forum
    Replies: 1
    Last Post: July 6th 2009, 06:20 PM
  5. Replies: 1
    Last Post: July 9th 2007, 03:51 AM

Search Tags


/mathhelpforum @mathhelpforum