# Midpoint of a diamond on square on a sphere

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

## 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 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 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 on other sites
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...

##### 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

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 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 on other sites
I'm sorry, but you'll have to draw a picture. I'm just not sure what you mean.

##### 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 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]

##### Share on other sites
Yes, right. Thanks for pointing out the error.

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 10
• 16
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
632928
• Total Posts
3009274
• ### Who's Online (See full list)

There are no registered users currently online

×