PDA

Click to See Complete Forum and Search --> : [RESOLVED] Lines and Arcs 2


sgrya1
Oct 31st, 2006, 01:00 PM
Hello again

Three part question I hope that someone can help me with.

Don't surpose there's a way of changing the status of a thread to unresolved?

This is a continuation the other thread I guess but to update...

I need to find a point on a line that passes through a circle.

Glaysher helped me this far.

y=mx
(x-a)²+(y-b)²=r²
substituting
(x-a)²+(mx-b)²=r²
multiplying out
x²-2ax+a²+(mx)²-2bmx+b²-r²=0
creating polynomial equation in terms of x
(m²+1)x²-(2a+2b)x +a²+b²-r²
Quadratic Solution
x=(-b±sqr(b²-4ac))/(2*a)
Substituting,
x=(2a+2b ±sqr((2a+2b)²-4*(m²+1)*(a²+b²-r²)))/(2*(m²+1))

So, if I have an arc with a=1, b=1, r=1
and a line of y=0.5x and to return an answer >a (+ instead of ±)

X=(2*1+2*1 +sqr((2*1+2*1)²-4*(0.5²+1)*(1²+1²-1²)))/(2*(0.5²+1))

in excel format
=(2*1+2*1 +sqrt((2*1+2*1) ^2-4*(0.5^2+1)*(1^2+1^2-1)))/(2*(0.5^2+1))
=2.96

Which is not the value of 2 which it should return. Where have I gone wrong?

And lastlly, how do i attach an image, when I click the button this comes up as text [IMG]? Seems to have worked, but how? I ended up attaching the drawing but it appears in the post.

sgrya1
Oct 31st, 2006, 04:21 PM
In the odd event that someone needs something like this I've just worked it out.

y=mx
(x-a)²+(y-b)²=r²
substituting
(x-a)²+(mx-b)²=r²
multiplying out
x²-2ax+a²+(mx)²-2bmx+b²-r²=0
creating polynomial equation in terms of x
(m²+1)x²-(2a+2bm)x +a²+b²-r²
Quadratic Solution
x=(-b±sqr(b²-4ac))/(2*a)
Substituting,
x=(2a+2bm ±sqr((2a+2bm)²-4*(m²+1)*(a²+b²-r²)))/(2*(m²+1))

Thanks to anyone who may have looked at this post and scratched their head.