|


Arc MidpointDate: 07/17/2001 at 20:17:45 From: Jon Subject: Arc midpoint Hi, I'm trying to figure out the midpoint of an arc where I know the start and end points of the arc and the radius only. I looked at your arc diagram but I was unable to determine how to calculate the midpoint value. Best regards, Jon Date: 07/19/2001 at 15:14:40 From: Doctor Jaffee Subject: Re: Arc midpoint Hi Jon, If you connect the endpoints of the arc with a segment, then draw a line that forms a 90-degree angle with the segment and passes through the midpoint of the segment, the line will pass through the midpoint of the arc. I hope this helps. Write back if any of my explanation requires clarification or if you have any other questions - Doctor Jaffee, The Math Forum http://mathforum.org/dr.math/
Date: 07/20/2001 at 00:28:27
From: Jon Platzner
Subject: Re: Arc midpoint
Doctor Jaffee,
Thank you for replying to my inquiry, I'm afraid that I didn't clarify
my question enough. I need the formula to calculate the X and Y
midpoints of an arc where I only know the end points and radius of the
arc. I can't use the drawing solution that you provided since the
formula will be used in a software function. I have a current formula
that I am using but this formula occasionally fails on arcs that are
180 degrees or greater.
LineMidX=(EndX+StartX)/2
LineMidY=(EndY+StartY)/2
LineLength=Sqrt(Power((EndX-StartX),2.0)+Power((EndY-StartY),2.0))
HalfLineLength=LineLength/2
{if half length is smaller than rad set delta length equal to rad}
if LineHalfLength<Rad then
AngTheata=RadToDeg(ArcSin(LineHafLength/Rad));
CtoMidLength:=Sqrt(Power(Rad,2.0)-Power(LineHafLength,2.0))
DeltaLength=Rad-CtoMidLng
end if
{try to determine which sector arc is in}
if (EndX<LineMidX) and (EndY>LineMidY) then
MidPointX=LineMidX-Cos(DegToRad(AngTheata))*DeltaLength
MidPointY=LinMidY-Sin(DegToRad(AngTheata))*DeltaLength
end if
Best regards,
Jon
Date: 07/24/2001 at 13:31:03
From: Doctor Jaffee
Subject: Re: Arc midpoint
Hi Jon,
I read over the program you are using to solve the problem and I can
see why you are having difficulties.
First of all, you need more information than the endpoints of the arc
and the radius of the circle to determine the midpoint of the arc
because there are really four possible answers. I'll show you what I
mean.
Draw two circles that have the same radius and that intersect at two
points. Label the two points A and B. If A and B are the two endpoints
of an arc and the radius is the radius of the circles you drew, then
there is a small arc (measuring less than 180 degrees) on one circle
and a large arc on the same circle starting at A and ending at B.
There are also two arcs on the other circle that have A and B as their
endpoints. Therefore, the midpoint of the arc can be at four different
locations, and unless more information is provided, you can't tell
which one it is.
Here is what your program does for you.
LineMidX and LineMidY find the midpoint of the segment that connects
the two endpoints of the arc.
LineLength calculates the length of that segment.
HalfLineLength calculates the length of half of the line. That
information is useful in determining the measure of angle theata.
However you stated "if half length is smaller than rad set delta
length equal to rad." I think what you meant was "if half the length
of that segment is equal to the radius, then set the length of segment
delta equal to the radius."
Now, here is how I would solve the problem. First, I'm going to use a
different notation than you have, but you can convert it back into
your own notation for the sake of your program.
A is the point at the start of the arc and A(x) will be what you
called StartX, the x-coordinate at that point. A(y) will mean StartY,
the y-coordinate at that point. Point B is the endpoint of the arc, so
B(x) and B(y) correspond to EndX and EndY, respectively.
The midpoint of the segment AB is the point P. In your program it is
called LineMid.
P(x) is LineMidX and P(y) is LineMidY.
r is the radius, so r - PC is what you would call delta.
The center of the circle is the point C, the same as in the program.
M is the midpoint of the arc, referred to in the program as MidPoint.
The measure of angle PCA is the same as AngTheata, which equals
(RadtoDeg(ArcSin(LineHalfLength/Rad))). I'm going to call it angle T.
However, the AngTheata you used to find MidPointX is a different
angle. I'm going to call it angle V. It is an angle whose vertex is
C, one ray going through P, and the other ray being either vertical or
horizontal, depending on the case. I'll explain that shortly.
Now, there are four cases to consider. In Case I A and B are
horizontal to each other; in other words, the slope of segment AB is
0. So, I would build into the program the test:
A(y) - B(y)
-------------- . If this expression equals 0, then we have Case I.
A(x) - B(x)
This expression, by the way, is the slope of segment AB.
Point M on the shorter arc of the lower circle would be
(P(x),P(y) -r+r* cosT).
Point M on the shorter arc of the upper circle would be
(P(x),P(y) +r-r*cosT).
Point M on the longer arc of the lower circle would be
(P(x),P(y) -r-r*cosT).
Point M on the longer arc of the upper circle would be
(P(x),P(y) +r+r*cosT).
Now, if
A(y) - B(y)
-------------- is undefined because the denominator is 0,
A(x) - B(x)
we have Case II; the two points A and B are vertical to each other.
In this case Point M on the shorter arc of the circle to the right
would be
(P(x) - r + r*cosT,P(y)).
Point M on the longer arc of the circle to the right would be
(P(x) + r + r*cosT,P(y)).
Point M on the shorter arc of the circle to the left would be
(P(x) + r - r*cosT,P(y)), and
Point M on the longer arc of the circle to the left would be
(P(x) - r - r*cosT,P(y)).
Next, if
A(y) - B(y)
-------------- is positive because B is to the right and higher
A(x) - B(x) than A,
we have Case III, and we have to introduce angle V whose measure is
the same as the angle RCP, where R is below and vertical to C.
V = arctan(slope of AB).
Point M on the shorter arc of the circle to the left would be
(P(x)+(r-r*cosT)(sinV),P(y)-(r-r*cosT)(cosV)), and
Point M on the longer arc of the circle to the left would be
(P(x)-(r-r*cosT)(sinV),P(y)+(r+r*cosT)(cosV)).
Finally, if
A(y) - B(y)
-------------- is negative because B is to the right and
A(x) - B(x) lower than A,
we have Case IV. The measure of angle V is arctan(-1/slope of AB) in
this case.
Point M on the smaller arc of the circle to the left will have as its
coordinates
(P(x) + (r-r*cosT)cosV,P(y)+(r+r*cosT)sinV)
Point M on the longer arc of the circle to the left will have as its
coordinates
(P(x) - (r+r*cosT)cosV,P(y)-(r+r*cosT)sinV)
Try incorporating what I have written into your program and see if you
have more success. Write back if you want to discuss this problem
some more.
- Doctor Jaffee, The Math Forum
http://mathforum.org/dr.math/
Date: 07/24/2001 at 13:56:31
From: Jon Platzner
Subject: Re: Arc midpoint
Doctor Jaffee,
I appreciate the time and effort that you spent to understand and
reply to the problem that I sent you. Your response was very clear and
helpful. I will certainly try the changes that you suggested and it is
nice to hear from someone who knows enough about trig to figure out
the solution.
Best regards,
Jon
|
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]


Ask Dr. MathTM
© 1994-2011 The Math Forum
http://mathforum.org/dr.math/