Calculating coordinates for Inner / transverse common tangent points
Show older comments
Hello all,
I've been trying to calculate this for sometime and have not had much luck. I am trying to calculate the coordinates for the four points in which two inner common tangent lines intersect with two circles. It is assumed that the two circles at coordinates C1 = [x1 y1] and C2 = [x2 y2] circles are of equal radii.
I have found something similar
However, this calculates the coordinates for the outer common tangent points. I have found plenty of resources regarding the lengths of the tangent lines but I am trying to determine the exact coordinates along the circle in which they intersect/touch.
Similar to this image:

Any assistance would be greatly appreciated,
Thank you!
Accepted Answer
More Answers (1)
I have made a pragmatic solution to do what is asked for based on these sources:
I tried finding a nicer solotion for the tangential points of the inner tangents, but I could not find it.
clc;
clear all;
close all;
% circle 1
x1 = 0;
y1 = 0.4;
r1 = 0.4;
% circle 2
x2 = 1;
y2 = 0;
r2 = 0.1;
% plotting the two circles
figure
circle_(x1,y1,r1,'k')
hold on
circle_(x2,y2,r2,'k')
axis equal
% The outer tangent lines https://en.wikipedia.org/wiki/Tangent_lines_to_circles
Deltax = x2-x1;
Deltay = y2-y1;
Deltar = r2-r1;
d = sqrt(Deltax^2+Deltay^2);
X = Deltax/d;
Y = Deltay/d;
R = Deltar/d;
k = 1;
a = R*X-k*Y*sqrt(1-R^2);
b = R*Y+k*X*sqrt(1-R^2);
c = r1-(a*x1 + b*y1);
x = -0.2:0.01:1.2;
y = (a*x + c)/(-b);
plot(x,y)
k = -1;
a = R*X-k*Y*sqrt(1-R^2);
b = R*Y+k*X*sqrt(1-R^2);
c = r1-(a*x1 + b*y1);
x = -0.2:0.01:1.2;
y = (a*x + c)/(-b);
plot(x,y)
%internal homothetic center https://en.wikipedia.org/wiki/Homothetic_center
hcx = r2/(r1+r2)*x1 + r1/(r1+r2)*x2;
hcy = r2/(r1+r2)*y1 + r1/(r1+r2)*y2;
plot(hcx,hcy,'*')
%tangent points on each cicle from a straight line going through the
%homothetic center.
%https://se.mathworks.com/matlabcentral/answers/86365-how-can-i-draw-a-tangent-line-from-a-given-point-to-a-circle-in-matlab
P = [hcx hcy]-[x1 y1];
d2 = dot(P,P);
Q0 = [x1 y1]+r1^2/d2*P;
T = r1/d2*sqrt(d2-r1^2)*P*[0,1;-1,0];
Q1_1 = Q0+T;
Q1_2 = Q0-T;
plot(Q1_1(1), Q1_1(2),'*')
plot(Q1_2(1), Q1_2(2),'*')
P = [hcx hcy]-[x2 y2];
d2 = dot(P,P);
Q0 = [x2 y2]+r2^2/d2*P;
T = r2/d2*sqrt(d2-r2^2)*P*[0,1;-1,0];
Q2_1 = Q0+T;
Q2_2 = Q0-T;
plot(Q2_1(1), Q2_1(2),'*')
plot(Q2_2(1), Q2_2(2),'*')
plot([Q1_1(1),Q2_1(1)], [Q1_1(2),Q2_1(2)],'-*')
plot([Q1_2(1),Q2_2(1)], [Q1_2(2),Q2_2(2)],'-*')
function circle_(x,y,r,opt)
th = 0:pi/50:2*pi;
xunit = r * cos(th) + x;
yunit = r * sin(th) + y;
plot(xunit, yunit, opt);
end
Categories
Find more on Interpolation 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!