# Coordinates of a random point of a circle?

1. Sep 19, 2007

### M40

Hi.

If the radius of a circle is known and it's also known that its center is at X:0, Y:0, how can the points that form the circle be calculated? What would be the coordinates of a random point of the circle?

I made a simple illustration hoping that it would make the question a little clearer.

Any help would be fantastic.

Thank you!

#### Attached Files:

• ###### circle_question.gif
File size:
4.1 KB
Views:
229
Last edited: Sep 19, 2007
2. Sep 19, 2007

### ice109

theres an equation for this

3. Sep 20, 2007

### M40

That's great! I'd love know what would be that equation.

I found the following:

In an x-y coordinate system, the circle with centre (0, 0) and radius r is the set of all points (x, y) such that:
$${x}^2+{y}^2={r}^2$$

But I'm not sure how to find the coordinates of a random point using this formula.

4. Sep 20, 2007

### HallsofIvy

That depends strongly on what you mean by "random". You could, for example, choose x "randomly" (uniform distribution) between -r and r and then calculate y by $y= \pm\sqrt{r^2- x^2}$, choosing the "+" and "-" randomly with probability 1/2 for each.

A different way would be to use the "angle", $\theta$. Choose $\theta$ randomly (uniform distribution) between 0 and $2\pi$. Then use the formulas x= r cos($\theta$), y= r sin$\theta$. Notice that since $sin^2(\theta)+ cos^2(\theta)= 1$ that gives the same as $x^2+ y^2= r^2$.

This is, by the way, for a point on the circle, not a point in the disk. In order to choose points "randomly" in the disk $x^2+ y^2\le R^2$, choose two numbers, r chosen randomly between 0 and R, $\theta$ chosen randomly between 0 and $2\pi$ and then use $x= r cos(\theta)$, $y= r sin(\theta)$ to find the point (x,y).

Last edited by a moderator: Sep 20, 2007
5. Sep 20, 2007

### ice109

i took the statement to be " find an arbitrary point"

6. Sep 20, 2007

### M40

Thank you very much HallsofIvy, that's really helpful!

7. Sep 20, 2007

### D H

Staff Emeritus
Halls, you didn't specify how to choose r between 0 and R. Assuming you meant a uniform distribution, the selected points will not be uniformly distributed on the disk. Choosing r2 randomly between 0 and R2 will result in a uniform distribution over the disk. Another approach is to choose x and y randomly between -R and R. Repeatedly draw pairs until x2 + y2 < R2.

8. Sep 20, 2007

### Chris Hillman

This is a famous trick question!

I just want to emphasize that these two methods really are, as Halls said, different! Assuming y'all have drawn a picture, can you see that the first way makes it more likely that our "random" point will lie in the top or bottom quarter arcs rather than the left or right quarter arcs? These are both perfectly valid probability measures, but the second one is more likely to correspond to what most people probably expect when we say "choose a point at random on the circle".

The circle happens to be a compact Lie group, so it has a unique bi-invariant probability measure, Haar measure. Only the second probability measure described by Halls is invariant under the rotational symmetry of the circle! This second measure is in fact the Haar probability measure on $SO(2)$.

More generally, you can ask to "choose a random element" in other compact Lie groups such as $SO(n)$ or $SU(n)$, meaning "according to Haar measure", and then things get a little tricky. It's important to get this right if you are simulating a quantum system. See Francesco Meddrazzi, "How to Generate Random Matrices from the Classical Compact Groups ", Notices of the AMS 54 (2007): 592-604 http://www.ams.org/notices/200705/fea-mezzadri-web.pdf

Last edited: Sep 20, 2007
9. Sep 20, 2007

### D H

Staff Emeritus
Even Halls' second probability measure does not quite correspond to what people expect of a point "chosen randomly on the circle".The random points will tend to cluster around the center by making the radius a uniform random variable. A slightly different approach is needed to make the distribution uniform in terms of area.

The distinction is important because a point drawn randomly from the unit disk forms the basis for many other random distributions such as the normal distribution. To generate a normal variate, one first draws a random point from a distribution spread uniformly in terms of area over the unit disk and then transforms this point to a pair of normal deviates using either the Box-Müller transform or the Marsaglia polar method.

10. Sep 21, 2007

### Chris Hillman

Huh? You seem to be talking about choosing a point in a disk, but Halls was careful to state that he is talking about choosing a point on the circle (boundary of the disk). More generally, it is clear that "randomly choosing" a point from a ball is a completely different proposition from "randomly choosing" a point on a sphere (boundary of the ball).

In case this wasn't clear, I have been talking about the two alternate methods Halls discussed for choosing "at random" a point on a circle of fixed radius. (First two paragraphs of his post above.)

Last edited: Sep 21, 2007
11. Sep 21, 2007

### D H

Staff Emeritus
I was talking at cross-purposes. I addressed the second part of Halls' post (below). I did not read your post carefully enough to realize that you were addressing the first part of his post. And yes, I do know the difference between a set and its boundary. Honest!

12. Sep 21, 2007

### Chris Hillman

Ok

13. Sep 21, 2007

### HallsofIvy

You're right, I did not specify what distribution to use for r. Sneaky of me wasn't it! Actually the original post said only "random point" and did not say it had to be uniform over either the circle or the disk.

14. Apr 22, 2009

### ikhal

What about if the center of the circle is not at the origin?but still the radius is known.how we calculate 10 evenly points (xi,yi) on the circle? anyone can help?

15. Apr 23, 2009

### HallsofIvy

If the center of the circle is at (a, b) and the circle has radius r, then
$$(x-a)^2+ (y-b)^2= r^2$$

Last edited by a moderator: Jan 3, 2011
16. Apr 23, 2009

### ikhal

Thanks HallsofIvy, but lets say i know one point (x1,y1) on the circle,is that possible to calculate another 9points that lie evenly on the circle?

17. Apr 23, 2009

### HallsofIvy

It's still not clear what you want to do. You first asked about random points on a circle. What do you mean by "random"? As has been pointed out above, you could assume that x is uniformly distributed between -r and r and the calculate y. Or you could assume that the angle, $\theta$ the line from the center of the circle to the point on the circl makes with the "positive x-axis" is uniformly distributed between 0 and 360 degrees and calculate x and y with $x= a+ r cos(\theta)$, $y= b+ r sin(\theta)$. ((a,b) is the center of the circle.) Or, you might use some other, non-uniform, distribution for x or $\theta$, giving completely different results.

Now you ask "lets say i know one point (x1,y1) on the circle,is that possible to calculate another 9 points that lie evenly on the circle?". I assume that by "lie evenly on the circle" you mean equal distances between the points. Since there are 360 degrees in a circle 10 points, the points must be 360/10= 36 degrees apart. You can get the angle for the first point by
$$tan(\theta)= \frac{sin(\theta)}{cos(\theta)}= \frac{y_1}{x_1}$$

Once you know $\theta$, calculate the other 9 points with
$$x= r cos(\theta+ 36n)$$ [tex]y= r sin(\theta+ 36n[\tex]
with n from 1 to 9. Be sure your calculator is in degree mode!

18. Apr 23, 2009

### ikhal

i used your formulas but what i got is the points forming a circle centered at origin with the given radius r which is not what i expect. so here the questions to make sure what i did is correct: when you said x is uniformly distributed between -r and r , is r=radius of the circle? are angles of theta always same for each x value (apart from the additional values of 36n)?

p/s they are not random points but are specific points on the ring equally distance between points.

the sketch of my problem is like in the attachment which only point (x1,y1) and (a,b) are known.i want to find the other 9 coordinates.really sorry i dont know how to explain very well.

#### Attached Files:

• ###### Doc1.doc
File size:
49 KB
Views:
72
Last edited: Apr 23, 2009
19. Apr 23, 2009

### ikhal

Okay I think i manage to solve my problem when I combine those two types of formulas that you gave me. It becomes x=a+r cos {(y1/x1)+36n} and y=b+r sin {(y1/x1)+36n}. is it make sense? thankk youuuu very much btw....