How to express a circle in spherical coordinates

TBTTyler
Messages
3
Reaction score
0
I've got a unit sphere sitting at the origin. This sphere is cut by an arbitrary plane. I'm looking to find the equation of the circle that results from the intersection in spherical coordinates.

This is for a computer program I'm writing, and I've already set it up to approximate this by sampling (which is pretty easy), but I've been wracking my brain on this one. I don't even know where to start.

If anybody could suggest a good starting point, or a plan of attack, I don't mind doing the heavy lifting.

Thanks!
 
Physics news on Phys.org
You are really much better off using cartesian coordinates.

We first parametrize a vector x(t) by x(t) = (cos(t),sin(t),0) for 0 < t < 2pi.

Now all you need to do is find some orthogonal linear transformation (i.e. matrix) which takes the vector (0,0,1) to the vector n = (n1,n2,n3), where n is the normal vector to the plane you want the circle to lie in. This will essentially be a rotation matrix (with a possible reflection).

There will be many such orthogonal linear transformations, because you are only determining where the vector (0,0,1) goes, and you don't care about where the other two basis vectors go, so long as all the vectors remain orthogonal.

If we call such a matrix M, then Mx(t) will parametrize the circle you want.

The only question left is how to find such a matrix.

We want it to be of the form:

[a d n1]
[b e n2]
[c f n3]

Where the vectors (a,b,c) and (d,e,f) are orthogonal to each other, and to n.

We want it to be of this form, because this ensures the vector (0,0,1) gets sent to n.

Now you just need to figure out how to choose (a,b,c) and (d,e,f). You can do this mechanically, however, by applying the Gram-Schmidt Process :http://en.wikipedia.org/wiki/Gram–Schmidt_process

First, determine a coordinate plane that n does NOT lie in. Then choose the two basis vectors for that plane. For example, so long a n isn't of the form (n1,n2,0), we can choose the basis vectors (1,0,0) and (0,1,0) to apply the G-S process to.

Now we have three vectors, n, (1,0,0), and (0,1,0). You apply the G-S process as in the article, with n as the first vector, and then you will end up with three new vectors: n, (a,b,c), and (d,e,f) which will be orthogonal. You have now determined the coefficients of the matrix M.

Now simply carry out the multiplication Mx(t) and you will have parametrized the circle.
 
I'm intersecting a plane with a NURBS sphere, and I need the intersection in uv space, so I really do need the circle in spherical coodinates.

I found a possible path to a solution. A circle is just the distance from a point, so I'm going to try using the great circle distance equation to get the solution

Edit:
http://en.wikipedia.org/wiki/Great-circle_distance
I used the first formula from that page because my circles are going to be relatively large on the sphere.
I just plugged in y and x for the standpoint Latitude and Longitude, and solved for y

y = acos( (cos(a) - sin(p)sin(x)) / (cos(p)cos(x)) ) + L
Where a is the internal angle formed by the circle's center, the center of the sphere, and any point on the circle.
p is the latitude of the center of the circle
L is the longitude of the center of the circle

The graph for this only shows half of the curve, but it's trivial to mirror it
 
Last edited:
just a quick note: be careful you don't model your circles as great circles unless they really are, you mentioned using 'arbitrary planes'...
 
homology said:
just a quick note: be careful you don't model your circles as great circles unless they really are, you mentioned using 'arbitrary planes'...

Indeed I did, but I think you're misinterpreting what I said. I only mention great circles because they are the geodesics of a sphere.
You're saying the planar equivalent of "Be careful you don't make your circle a straight line" just because I mentioned that radii were straight lines :)

I would just have to set the variable "a" to pi/2 to make great circles.
 
Back
Top