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

• Sep 18th 2010, 08:57 PM
Korinkite
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?
• Sep 20th 2010, 10:53 AM
earboth
Quote:

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".
• Sep 20th 2010, 11:07 AM
Ackbeet
You can solve this by using matrices of rotation. Define $O$ to be the center of the circle, and $A$ and $B$ are the two randomly chosen points on the circle. Define $\theta$ to be the angle in the interval $[0,\pi]$ between the two vectors $OA$ and $OB.$ Then the midpoint $M$ would be the tip of the vector obtained by rotating $OA$ to $OB$ through an angle of $\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.
• Sep 21st 2010, 01:56 PM
Korinkite
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 ^_^.
• Sep 22nd 2010, 09:36 AM
wonderboy1953
Quote:

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.
• Sep 22nd 2010, 09:39 AM
Ackbeet

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.
• Sep 23rd 2010, 04:15 AM
Korinkite
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.
• Sep 24th 2010, 06:34 AM
Ackbeet
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?
• Sep 25th 2010, 04:12 AM
CaptainBlack
Quote:

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