Midpoint of a diamond on square on a sphere

Started by
8 comments, last by byhisdeeds 18 years, 3 months ago
Hi, I'm noew to this forum so please forgive me if I ask silly questions. I have a square in 3D cartesian space and have the coordinates for 3 of the 4 corner nodes. I am projecting the square onto a sphere and displaying, and require to be able to know the coordinates of the midpoint (center) of the square. Does anybody know hw I can do it. Just taking the midpoint of the diagonal does not give me the mid point of the square when projected on a sphere.
[ jROAM ]
Advertisement
on q square plane, if you take the midpoint of the diagonal segment you'll get the midpoint of the square of course but, I dont understand what do you mean by 'project the square on a sphere' :P
.
I have the 3D cartesian coordinates (x,y,z) of a unit cube and I transform these to a sphere of radius sqrt(3) and display these points. So I have a blocky sphere. For any face of the cube I want to find the midpoint, the point where the two diagonals intersect, so I can divide the faces evenly. However I only have three of the four corner coordinates at any given time. If I take the midpoint of the diagonal nodes It is does not divide the square into two equal sides.
[ jROAM ]
Why do you have only 3 of the 4 corners of your square?

Draw a picture


How about take a point that is equidistant to the 4 corners as the midpoint? I think that should work even when mapped to a curved surface...
So are you talking about a square or a cube? In the first post it was a square, in the second, it is a cube. Is it a cube projected on a sphere, therefore a square on a circle?

If that is the case, then three or four nodes is OK, because there will only be four anyways. You could get away with two if they were opposite corners.

If this is right, then the coordinates you are looking can be found this way:
p1 and p2 are points of the square, and are opposite corners.
c is the point that is the center of the sphere
r is the sphere's radius

The flat center of that square is f=(p1 + p2)/2
That point, projected on the sphere is:
r*(f-c)/|f-c|

where |f-c| is the length of the vector f-c.
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
OK. I have a cube which I will project all the size faces onto a sphere. So It looks like a blocky sphere. Now If I take the center of the faces and the 8 edge nodes I can draw squares/diamonds between adjacent face centers and the edge nodes in between them. If I have these squares/diamonds (depends on how you look at it) and I only have 3 of the four points and I want to find the center point that would allow me to split it equally when projected onto a sphere when I take the midpoint of any two diagonals, it seems to be the midpoint in one direction but not the other. Given any of the three points how can I find the midpoint of this quadralateral when projected ontp a sphere.
[ jROAM ]
I'm sorry, but you'll have to draw a picture. I'm just not sure what you mean.
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
Ok. I found it if you have the cartesian coordinates (x,yz) of two points on a sphere then the mid point is:


x = (x1+x2)*.5
y = (y1+y2)*.5
z = (z1+z2)*.5
r = sqrt(x*x+y*y+z*z)
x /= r
y /= r
z /= r



[ jROAM ]
Well, the last three steps should be
x *= a/r
y *= a/r
z *= a/r

Where a is the radius of the circle, or all of your face centers will be 1 unit away from the origin of the circle.

I thought that this is want you wanted, and it happens to be another way of writing the solution I posted [smile]

Glad it's solved.
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
Yes, right. Thanks for pointing out the error.
[ jROAM ]

This topic is closed to new replies.

Advertisement