I need to be able to choose random points on a spherical cap surface for which the radius and centre of the actual sphere are known.

I'd like to do so by simply restricting the range of possible spherical coordinates (rho,theta, phi as shown on http://mathinsight.org/spherical_coordinates) of points on the cap.

How can I calculate the ranges over which theta and phi can vary for points on the cap, if the cap is specified by the centre of its base and the angle from its normal vector to its base (as depicted on https://en.wikipedia.org/wiki/Spherical_cap)?

  • $\begingroup$ This is equivalent to this previous question: math.stackexchange.com/q/56784/856 $\endgroup$ – Rahul Dec 29 '16 at 19:02
  • $\begingroup$ Could you expand on this. I don't need uniform distribution. Just cutoffs for the two angles. $\endgroup$ – carrytiger Dec 29 '16 at 19:09
  • $\begingroup$ On the face of it, the problem seems trivial: $\phi$ varies from zero to the angle shown in the figure on the Wiki page you linked, $\theta$ varies from zero to $2\pi.$ That assumes you set up your spherical coordinates so the axis passes through the center of the cap. Is there a really good reason why you absolutely cannot do that? $\endgroup$ – David K Dec 29 '16 at 19:35
  • $\begingroup$ The reason the axis doesn't pass through the centre of the cap is that the origin is where the measurements are taken from and so needs to be able to be anywhere. I am trying to build test cases simulating this. $\endgroup$ – carrytiger Dec 29 '16 at 19:48
  • $\begingroup$ @DavidK Good idea. I could then simply 'move' the points via translation and rotation to the actual cap location. What would the angle of rotation be, and how to rotate a point? $\endgroup$ – carrytiger Dec 29 '16 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.