How to determine a semi-sphere's point x-y-z coordinates?
I'm having serious problems solving a problem illustrated on the pic below. Let's say we have 3 points in 3D space (blue dots), and the some center of the triangle based on them (red dot - point P). We also have a normal to this triangle, so that we know which semi-space we talking about.
I need to determine, what is the position on a point (red ??? point) that depends on two angles, both in range of 0-180 degrees. Doesnt matter how the alfa=0 and betha=0 angle is "anchored", it is only important to be able to scan the whole semi-sphere (of radius r).
开发者_开发知识库http://i.stack.imgur.com/a1h1B.png
If anybody could help me, I'd be really thankful.
Kind regards, Rav
From the drawing it looks as if the position of the point on the sphere is given by a form of spherical coordinates. Let r
be the radius of the sphere; let alpha
be given relative to the x-axis; and let beta
be the angle relative to the x-y-plane. The Cartesian coordinates of the point on the sphere are:
x = r * cos(beta) * cos(alpha)
y = r * cos(beta) * sin(alpha)
z = r * sin(beta)
Edit
But for a general coordinate frame with axes (L, M, N)
centered at (X, Y, Z)
the coordinates are (as in dmuir's answer):
(x, y, z) =
(X, Y, Z)
+ r * cos(beta) * cos(alpha) * L
+ r * cos(beta) * sin(alpha) * M
+ r * sin(beta) * N
The axes L
and N
must be orthogonal and M = cross(N, L)
. alpha
is given relative to L
, and beta
is given relative to the L
-M
plane. If you don't know how L
is related to points of the triangle, then the question can't be answered.
You need to find two unit length orthogonal vectors L, M say, in the plane of the triangle as well as the the unit normal N. The points on the sphere are
r*cos(beta)*cos(alpha) * L + r*cos(beta)*sin(alpha)*M + r*sin(beta)*N
精彩评论