Thread: How can you find the midpoint between two random points on a circle?

1. How can you find the midpoint between two random points on a circle?

Hey people! The question is basically in the title. Say you have two points on your standard circle, point 1: (x,y,z) and point 2: (u,v,c). (***This is meant to be used in a 3D dimensional space.).

I want to basically be able to place these two points anywhere on said circle (anywhere except both in the same spot) and derive the center between these two points, all the while keeping this midpoint on the circle as well.

Theoretically, since the midpoint lays on the circle and isn't linear, there are two "midpoints," one closer and the other further away in comparison. Thankfully, this problem would only arise in circles whose sweep goes past 180 degrees (a semi circle). I'm only dealing with arches up to 90 degrees so I only have to worry about the short midpoint.

So graphically, there's what I'm talking about:

CGSociety Stuff :: Arch Question Diagram picture by Korinkite - Photobucket

In this picture, the two yellow dots represent the two random points on the circle that I picked and the red is the shorthand midpoint. The long midpoint that I mentioned before, the one that I can effectively negate since I only work with arches of 90 degrees (or pi/2 jeez don't correct me), is signified with a good old green X over the green dot.

So back to the main question. In this setup that I have described above, a standard circle in a 3D space, is there a formula that I can use to find the "midpoint" between two random points of the circle?

2. Originally Posted by Korinkite
Hey people! The question is basically in the title. Say you have two points on your standard circle, point 1: (x,y,z) and point 2: (u,v,c). (***This is meant to be used in a 3D dimensional space.).

I want to basically be able to place these two points anywhere on said circle (anywhere except both in the same spot) and derive the center between these two points, all the while keeping this midpoint on the circle as well.

Theoretically, since the midpoint lays on the circle and isn't linear, there are two "midpoints," one closer and the other further away in comparison. Thankfully, this problem would only arise in circles whose sweep goes past 180 degrees (a semi circle). I'm only dealing with arches up to 90 degrees so I only have to worry about the short midpoint.

So graphically, there's what I'm talking about:

CGSociety Stuff :: Arch Question Diagram picture by Korinkite - Photobucket

...
1. In 2-D-space the "midpoint" is the intersection point of the perpendicular bisector of the 2 given points and the circle.

2. In 3-D-space you have to use a plane which is perpendicular to the line segment between the 2 given points and passing through the midpoint of this line segment. The "midpoint" is then the intersection between the circle and this plane.

3. To my knowledge there doesn't exist a simple formula which yields the coordinates of this "midpoint".

3. You can solve this by using matrices of rotation. Define $\displaystyle O$ to be the center of the circle, and $\displaystyle A$ and $\displaystyle B$ are the two randomly chosen points on the circle. Define $\displaystyle \theta$ to be the angle in the interval $\displaystyle [0,\pi]$ between the two vectors $\displaystyle OA$ and $\displaystyle OB.$ Then the midpoint $\displaystyle M$ would be the tip of the vector obtained by rotating $\displaystyle OA$ to $\displaystyle OB$ through an angle of $\displaystyle \theta/2.$

Here is a page that describes rotations about an arbitrary axis. Your result isn't going to be pretty, but I think you can get a general equation for the desired point.

4. Hey people! Thank you for your replies!

In the end, I decided to go with a version of Ackbeet's reply. I found that the math to find the angle between two point vectors (with the center of the circle being the midpoint), although admittedly something I could do with Autodesk Maya's MEL script....:

global proc MeasureAngle ()
{

float $firstPointLocation [] = pointPosition protractor1.cv[0]; print$firstPointLocation;

float $secondPointLocation [] = pointPosition protractor1.cv[1]; print$secondPointLocation;

float $thirdPointLocation [] = pointPosition protractor1.cv[2]; print$thirdPointLocation;

vector $vectorBA = <<1,1,1>>; vector$vectorBC = <<1,1,1>>;

float $firstPointX =$firstPointLocation[0];
float $firstPointY =$firstPointLocation[1];
float $firstPointZ =$firstPointLocation[2];

float $secondPointX =$secondPointLocation[0];
float $secondPointY =$secondPointLocation[1];
float $secondPointZ =$secondPointLocation[2];

float $thirdPointX =$thirdPointLocation[0];
float $thirdPointY =$thirdPointLocation[1];
float $thirdPointZ =$thirdPointLocation[2];

float $vectorBAX = ($secondPointX - $firstPointX); float$vectorBAY = ($secondPointY -$firstPointY);
float $vectorBAZ = ($secondPointZ - $firstPointZ);$vectorBA = << $vectorBAX,$vectorBAY, $vectorBAZ>>; float$vectorBCX = ($secondPointX -$thirdPointX);
float $vectorBCY = ($secondPointY - $thirdPointY); float$vectorBCZ = ($secondPointZ -$thirdPointZ);

$vectorBC = <<$vectorBCX, $vectorBCY,$vectorBCZ>>;

float $finalAngle = rad_to_deg (angle$vectorBA $vectorBC); float$otherAngle = (180-$finalAngle); print "\n"; print$finalAngle;

text -e -label $finalAngle angleText; text -e -label$otherAngle angle2Text;
}

MeasureAngleTool;

In truth though, I was trying to find ways around this because it is taxing on Maya's expression editor to use code like that so I broke things down using a system of constraints.

Basically, I made a circle and created two locators (locator A and locator C) that can have their coordinates tracked, both of which are constrained along the circle so they can never leave it. I have a third locator (locator B) in the center of the circle to track the circle's world coordinates. Finally, I have one last locator (locator D) to reference the midpoint between locator's A and C.

I created a line whose length is directly controlled by the radius of the circle, where one end is constrained to the center of the circle and the other end points to the midpoint locator D. I use the tip of the line segment to track the midpoint between the two points in this way.

CGSociety Stuff :: Math Forum Circle_Midpoint Solution (?) picture by Korinkite - Photobucket

I should think this would yield accurate results, and with the use of no expressions too!

Thank you Ackbeet and earboth for the idea ^_^.

5. Originally Posted by Korinkite
Hey people! The question is basically in the title. Say you have two points on your standard circle, point 1: (x,y,z) and point 2: (u,v,c). (***This is meant to be used in a 3D dimensional space.).

I want to basically be able to place these two points anywhere on said circle (anywhere except both in the same spot) and derive the center between these two points, all the while keeping this midpoint on the circle as well.

Theoretically, since the midpoint lays on the circle and isn't linear, there are two "midpoints," one closer and the other further away in comparison. Thankfully, this problem would only arise in circles whose sweep goes past 180 degrees (a semi circle). I'm only dealing with arches up to 90 degrees so I only have to worry about the short midpoint.

So graphically, there's what I'm talking about:

CGSociety Stuff :: Arch Question Diagram picture by Korinkite - Photobucket

In this picture, the two yellow dots represent the two random points on the circle that I picked and the red is the shorthand midpoint. The long midpoint that I mentioned before, the one that I can effectively negate since I only work with arches of 90 degrees (or pi/2 jeez don't correct me), is signified with a good old green X over the green dot.

So back to the main question. In this setup that I have described above, a standard circle in a 3D space, is there a formula that I can use to find the "midpoint" between two random points of the circle?
"I want to basically be able to place these two points anywhere on said circle (anywhere except both in the same spot) and derive the center between these two points, all the while keeping this midpoint on the circle as well." Using your given coordinates, the answer is the following: i = (x+u)/2, j = (y+v)/2, k = (z+c)/2 where (i,j,k) is your midpoint.

Unfortunately, that approach won't work. The midpoint is the midpoint as measured by arcs on the circle. It is not the midpoint of the straight line joining the two randomly chosen points.

7. Unfortunately no it wouldn't but the midpoint still has a use for my original question.

If you create a line segment going from the exact middle of the circle and aim it towards the midpoint that wonderboy described, so long as the line segment is always the radius of the circle, the tip of the line should always be the exact middle of the two points measured on the arc of the circle. Done deal :P.

Still, I'm curious to see if you could transform that process that I described into math using a vector array that takes the two points I mentioned here.

8. If you know the coordinates of the center of the circle, that's a perfectly good way to go. How do you think you'd go about doing it using this method?

9. Originally Posted by Korinkite
Hey people! The question is basically in the title. Say you have two points on your standard circle, point 1: (x,y,z) and point 2: (u,v,c). (***This is meant to be used in a 3D dimensional space.).
How is your "standard circle" characterised?

CB