Re: Circle center from point on circle
- From: David W. Cantrell <DWCantrell@xxxxxxxxxxx>
- Date: 21 Feb 2008 20:15:44 GMT
rob@xxxxxxxxxxxxxx (Rob Johnson) wrote:
In article <20080221112825.276$G6@xxxxxxxxxxxxxx>,
David W. Cantrell <DWCantrell@xxxxxxxxxxx> wrote:
David W. Cantrell <DWCantrell@xxxxxxxxxxx> wrote:
Anders Eriksson <andis59@xxxxxxxxx> wrote:
Hello!
I'm a programmer and need some math help!
In a cartesian coordinate system a point is specified (x1,y1). This
point is on the circle (with the radius r) and I also now the
tangent of the point (t).
You know the tangent at the specified point, and so you should also
know the slope m of that tangent.
I need to calculate the center of the circle as coordinates in the
same coordinate system (x2,y2)
The point may be anywhere in the coordinate system in all four
quadrants. I.e. x and y may be positive and negative or zero. E.g.
(-1, 0), (0,23), (25,-11), ...
You have not given enough information to determine the center of the
circle uniquely; there are possible centers on either side of the
tangent line at distance r from point (x1, y1).
The possible centers are
(x1 -/+ r/sqrt(1 + 1/m^2) , y1 +/- r/sqrt(m^2 + 1) )
Note: Opposite signs are to be used for the terms involving the square
roots.
Oops. I made a mistake. Sorry! What I gave above is incorrect if m < 0.
Correctly, the possible centers are
(x1 -/+ sign(m) r/sqrt(1 + 1/m^2) , y1 +/- r/sqrt(m^2 + 1) ).
For completeness, note that, if the tangent line is vertical, the
possible centers are (x1 +/- r, y1).
We can get rid of the sign() and unify the denominators to make
things look a little prettier with
( x1 -/+ m r/sqrt(m^2 + 1) , y1 +/- r/sqrt(m^2 + 1) )
There is a particular reason I chose not to give that form: It doesn't work
when the tangent happens to be vertical. You might object, saying that the
form I gave doesn't work when the tangent is vertical either. But it
actually does work. The slope of a vertical line is oo,
positive-or-negative infinity. For the center's y-coordinate,
y1 +/- r/sqrt(oo^2 + 1) = y1 +/- r/oo = y1 +/- 0 = y1;
for the center's x-coordinate,
x1 -/+ sign(oo) r/sqrt(1 + 1/oo^2) = x1 -/+ (+/-1) r/sqrt(1 + 0) = x1 +/- r
having taken sign(oo) to be bivalued.
BTW, the reason I had said "For completeness, note..." is merely that I
thought Anders might not want to use extended arithmetic. But my preference
is to present a single result which works in _all_ cases.
On further reflection, I regret having mentioned slope at all. Here's a
nicer method. Let (x2, y2) be any point on the tangent line, distinct from
(x1, y1). Then the possible centers of the circle are
(x1 -/+ (y2 - y1) r/sqrt((x2 - x1)^2 + (y2 - y1)^2),
y1 +/- (x2 - x1) r/sqrt((x2 - x1)^2 + (y2 - y1)^2)).
David
.
- References:
- Circle center from point on circle
- From: Anders Eriksson
- Re: Circle center from point on circle
- From: David W . Cantrell
- Re: Circle center from point on circle
- From: David W . Cantrell
- Re: Circle center from point on circle
- From: Rob Johnson
- Circle center from point on circle
- Prev by Date: Re: New symbolic/numeric/dynamic/intuitive programming language
- Next by Date: Re: New symbolic/numeric/dynamic/intuitive programming language
- Previous by thread: Re: Circle center from point on circle
- Next by thread: Re: Circle center from point on circle
- Index(es):
Relevant Pages
|