Sign in to follow this  

Midpoint of a diamond on square on a sphere

This topic is 4357 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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



Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4357 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this