Re: [Tutor] Find Integer co-ordinates lying on a circle

2009-11-15 Thread Shashwat Anand
regarding Integer co-ordinates within a circle got a nice link : http://mathworld.wolfram.com/GausssCircleProblem.html ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Find Integer co-ordinates lying on a circle

2009-11-15 Thread Shashwat Anand
@DaveA: thanks for pointing it out. For a origin-centre circle x**2 + y**2 = r**2, I assumed r to be integer, however it was r**2 which was integer. A mistake on my part. On Mon, Nov 16, 2009 at 6:41 AM, Dave Angel wrote: > spir wrote: > >> Le Sun, 15 Nov 2009 09:11:16 +0530, >> Shashwat Anand

Re: [Tutor] Find Integer co-ordinates lying on a circle

2009-11-15 Thread Dave Angel
spir wrote: Le Sun, 15 Nov 2009 09:11:16 +0530, Shashwat Anand s'exprima ainsi: No, I'm trying to find all integer co-ordinates which lies on a circle. Say for a circle of radius 5 the co-ordinates are [(5, 0), (0, 5), (-5, 0), (0, -5), (3, 4), (4,3), (3, -4), (4, -3), (-3, 4), (-4

Re: [Tutor] Find Integer co-ordinates lying on a circle

2009-11-15 Thread spir
Le Sun, 15 Nov 2009 09:11:16 +0530, Shashwat Anand s'exprima ainsi: > > No, I'm trying to find all integer co-ordinates which lies on a circle. > Say for a circle of radius 5 the co-ordinates are [(5, 0), (0, 5), (-5, 0), > (0, -5), (3, 4), (4,3), (3, -4), (4, -3), (-3, > 4), (-4, 3), (-3, -4),

Re: [Tutor] Find Integer co-ordinates lying on a circle

2009-11-15 Thread Gerard Flanagan
Shashwat Anand wrote: > How to find all possible integer co-ordinates lying on a circle of given radius 'r'. > If given the upper bound of 'r', I want to calculate all given co-ordinates lying for 0 <= r <= n > > Let's say the upper bound of radius is 5 > All possible results are: > radius 'r'

Re: [Tutor] Find Integer co-ordinates lying on a circle

2009-11-14 Thread Dave Angel
Shashwat Anand wrote: Your "all possible results" isn't even close to all the points that match the 0<= r <= 5. And I don't know how either spec justifies the set logic you quoted. So I have to start over. I think you're trying to find all integer co-ordinates which lie on or within

Re: [Tutor] Find Integer co-ordinates lying on a circle

2009-11-14 Thread Shashwat Anand
> > Your "all possible results" isn't even close to all the points that match > the 0<= r <= 5. And I don't know how either spec justifies the set logic > you quoted. > > So I have to start over. I think you're trying to find all integer > co-ordinates which lie on or within a circle of given ra

Re: [Tutor] Find Integer co-ordinates lying on a circle

2009-11-14 Thread Dave Angel
Shashwat Anand wrote: How to find all possible integer co-ordinates lying on a circle of given radius 'r'. If given the upper bound of 'r', I want to calculate all given co-ordinates lying for 0 <= r <= n Let's say the upper bound of radius is 5 All possible results are: radius 'r' - (x, y) 0

[Tutor] Find Integer co-ordinates lying on a circle

2009-11-14 Thread Shashwat Anand
How to find all possible integer co-ordinates lying on a circle of given radius 'r'. If given the upper bound of 'r', I want to calculate all given co-ordinates lying for 0 <= r <= n Let's say the upper bound of radius is 5 All possible results are: radius 'r' - (x, y) 0 - (0, 0) 1 - (1, 0), (0, 1