Circle-line intersection
From: Johannes Bergmark (johannes.bergmark_at_bredband.net)
Date: 12/03/04
- Next message: Patrick D. Rockwell: "Re: Bessel Numbers, Borel Numbers."
- Previous message: Norm Dresner: "Re: Escultura affair: publication scandal"
- Next in thread: Arturo Magidin: "Re: Circle-line intersection"
- Reply: Arturo Magidin: "Re: Circle-line intersection"
- Messages sorted by: [ date ] [ thread ]
Date: 3 Dec 2004 12:43:32 -0800
Hi there!
Don't tell me to look at other posts in this forum. This is a special
problem aimed to they who know math. The question how the get 't',
look below. I thought I solved the problem but the outcome was a
failure. I got a correct equation from mathworld but that is not what
I want though.
A line(L) intersects with a circle(C), tell me if something is wrong.
All positions orients from circle position which is (0,0).
t is what I want.
L = A + (B-A)*t
where D = B-A
Lx = cos(v)*R
Ly = sin(v)*R
A combination of equations: cos(v)*R = Ax + (Dx)*t
sin(v)*R = Ay + (Dy)*t
I do this because the points of the line intersects on the circle-line
which distance is R from origo. 'cos(v)*R' is the horizontal distance
and sin(v)*R is the vertical distance. Hope you understand my thinking
here. Only if could draw with a pen :).
And no we do 'power of two' at both sides of equation. This I do
because
of a forumla which I've to merge with this equation, see below.
cos^2(v)*R^2 = (Ax + Dx*t)^2
which also are
((Ax + Dx*t)^2)
cos^2(v) = --------------------
R^2
sin^2(v)*R^2 = (Ay + Dy*t)^2
which also are
((Ay + Dy*t)^2)
sin^2(v) = --------------------
R^2
Ok now to the hard part.
This is a math rule:
sin^2(v) + cos^2(v) = 1
and this gives
cos^2(v) = 1 - sin^2(v)
Now we combine the first combination with the formula above:
((Ax + Dx*t)^2)
cos^2(v) = --------------------
R^2
will be
((Ax + Dx*t)^2)
1 - sin^2(v) = --------------------
R^2
And know we just take away the sin-function:
((Ay + Dy*t)^2) ((Ax + Dx*t)^2)
1 - -------------------- = --------------------
R^2 R^2
Now I can get 't'. The equation will be, after some flipping and
flopping of the variables, look like this:
t^2*(Dx^2 + Dy^2) + t*(2*Ax*Dx + 2*Ay*Dy) - R^2 + Ay^2 + Ax^2 = 0
If you don't see what this is I tell you this: ax^2 + bx + c = 0
Now if you know what math is you know what it is.
Now the question: "Why DOESN'T THIS WORK!!!" :|
/Thank you for reading through, Johannes Bergmark
- Next message: Patrick D. Rockwell: "Re: Bessel Numbers, Borel Numbers."
- Previous message: Norm Dresner: "Re: Escultura affair: publication scandal"
- Next in thread: Arturo Magidin: "Re: Circle-line intersection"
- Reply: Arturo Magidin: "Re: Circle-line intersection"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|