Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Coordinates of a random point of a circle?

  1. Sep 19, 2007 #1

    M40

    User Avatar

    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:

    Last edited: Sep 19, 2007
  2. jcsd
  3. Sep 19, 2007 #2
    theres an equation for this
     
  4. Sep 20, 2007 #3

    M40

    User Avatar

    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:
    [tex]{x}^2+{y}^2={r}^2[/tex]

    But I'm not sure how to find the coordinates of a random point using this formula.
     
  5. Sep 20, 2007 #4

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    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 [itex]y= \pm\sqrt{r^2- x^2}[/itex], choosing the "+" and "-" randomly with probability 1/2 for each.

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

    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 [itex]x^2+ y^2\le R^2[/itex], choose two numbers, r chosen randomly between 0 and R, [itex]\theta[/itex] chosen randomly between 0 and [itex]2\pi[/itex] and then use [itex]x= r cos(\theta)[/itex], [itex]y= r sin(\theta)[/itex] to find the point (x,y).
     
    Last edited: Sep 20, 2007
  6. Sep 20, 2007 #5
    i took the statement to be " find an arbitrary point"
     
  7. Sep 20, 2007 #6

    M40

    User Avatar

    Thank you very much HallsofIvy, that's really helpful!
     
  8. Sep 20, 2007 #7

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    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.
     
  9. Sep 20, 2007 #8

    Chris Hillman

    User Avatar
    Science Advisor

    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 [itex]SO(2)[/itex].

    More generally, you can ask to "choose a random element" in other compact Lie groups such as [itex]SO(n)[/itex] or [itex]SU(n)[/itex], 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
  10. Sep 20, 2007 #9

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    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.
     
  11. Sep 21, 2007 #10

    Chris Hillman

    User Avatar
    Science Advisor

    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
  12. Sep 21, 2007 #11

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    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!

     
  13. Sep 21, 2007 #12

    Chris Hillman

    User Avatar
    Science Advisor

  14. Sep 21, 2007 #13

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    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.
     
  15. Apr 22, 2009 #14
    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?
     
  16. Apr 23, 2009 #15

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    If the center of the circle is at (a, b) and the circle has radius r, then
    [tex](x-a)^2+ (y-b)^2= r^2[/tex]
     
    Last edited: Jan 3, 2011
  17. Apr 23, 2009 #16
    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?
     
  18. Apr 23, 2009 #17

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    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, [itex]\theta[/itex] 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 [itex]x= a+ r cos(\theta)[/itex], [itex]y= b+ r sin(\theta)[/itex]. ((a,b) is the center of the circle.) Or, you might use some other, non-uniform, distribution for x or [itex]\theta[/itex], 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
    [tex]tan(\theta)= \frac{sin(\theta)}{cos(\theta)}= \frac{y_1}{x_1}[/tex]

    Once you know [itex]\theta[/itex], calculate the other 9 points with
    [tex]x= r cos(\theta+ 36n)[/tex] [tex]y= r sin(\theta+ 36n[\tex]
    with n from 1 to 9. Be sure your calculator is in degree mode!
     
  19. Apr 23, 2009 #18
    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:

    Last edited: Apr 23, 2009
  20. Apr 23, 2009 #19
    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....
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Coordinates of a random point of a circle?
  1. Random coordinate (Replies: 14)

  2. Points on a circle. (Replies: 6)

Loading...