1

Possible Duplicate:
Generate a random direction within a cone

A point on a unit sphere $(x,y,z)$ and an maximal angular separation $\theta$ defines a patch with an area of $\Omega = 2 \pi (1-\cos \theta)$ steradians. How can I uniformly sample over that patch?

Currently I'm generating points on the sphere and rejecting all those not within the allowed region. Can I do this without rejection?

Hooked
  • 6,637
  • 1
    Warning: That question is indeed a duplicate, but it's got many bad or suboptimal answers, including the most upvoted one, and the only really helpful one didn't have any upvotes before I just upvoted it. I'm going to write an answer and will try to summarize and clarify the correct parts of the existing answers. – joriki Oct 01 '12 at 19:54
  • OK, I've written an answer to the other question. Please consider upvoting Christian's and/or my answer so they get noticed among all the noise the question has produced; this is a fairly important question that often comes up in practice, and people should be able to find the simple solution for it. – joriki Oct 01 '12 at 20:17
  • @joriki I'm happy to close this question, but to help the linking do you want to put a small summary as an answer to this question here and link to your other (longer) answer? I mention this because I feel that this phrasing in this question might be different enough for someone searching not to find the other post. – Hooked Oct 01 '12 at 20:49
  • @Hooked: I was hoping that enough people would vote to close as duplicate that there would automatically be an official link to the other question at the top; if that doesn't happen I'll be happy to write a summary here. – joriki Oct 01 '12 at 21:03
  • @joriki: I was about to write an answer like that here before I noticed all the comments; I love that curiosity about the $2$-sphere. (I’ve added my close vote.) – Brian M. Scott Oct 02 '12 at 04:50
  • @joriki and others - I'm voting to close my own question as the new and updated answers on the other question are more than enough. Thank you all! – Hooked Oct 02 '12 at 13:25

0 Answers0