Tangent to two circles
Show older comments
Hello everyone!
Have spent the enitre few days trying to figure this problem out, but Im going nowhere.
Problem is I have the coordinates for two circles C1(-1,1) and C2(2,2.5) with radius r1 = 1 and r2 = 1.5. Now I have to write a program that calculates the coordinates for the points of the outer common tangent (p1 and p2) to these two circles. I know there are many ways of doing so, one of them being that you write a system of equations with the help of these relations:
(p1-c1)*(p1-p2)=0 (the radius for the circles are perpendicular to the line between the circle centers)
(p2-c2)*(p1-p2)=0
and
Abs(p1-c1)^2=r1^2 (these conditions are so that the points are on the circles)
Abs(p2-c2)^2=r2^2
I'm thinking that you have to solve p1 and p2 from these equations but I just don't know how to do it. Please if anyone could help me I would be so very grateful!
Accepted Answer
More Answers (1)
Hi,
the 3rd and 4th equations shouldn't be as the folliwing, right?
p1^2-c1^2=r1^2
p2^2-c2^2=r2^2
you can use fsolve or solve if you need a symbolic solution. Anyway I think it might be easily solved by hand.
2 Comments
Matt J
on 16 Nov 2014
The equations should have reduced to linear ones, easily solvable using mldivide.
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!