# 3 circles of different sizes and
# without points in common.
# For each pair of circles I draw
# the two common tangents and
# consider their point of
# intersection.
# The three points lie on the same
# line!
    
source("http://macosa.dima.unige.it/r.R") BF=3; HF=3 PLANE(-1,16,-1,16) C1 = c(3,3); R1 = 2.5; C2 = c(9,5.5); R2 = 1; C3 = c(6,8); R3 = 1.5 circle(C1[1],C1[2], R1,"brown"); circle(C2[1],C2[2], R2,"brown"); circle(C3[1],C3[2], R3,"brown") line_line(C1[1],C1[2],C2[1],C2[2], C1[1]-R1,C1[2],C2[1]-R2,C2[2]) P = c(solut[1],solut[2]); Q = P_tan(P[1],P[2], C1[1],C1[2], R1) l2p(Q[1],Q[2], P[1],P[2], "seagreen"); l2p(Q[3],Q[4], P[1],P[2], "seagreen") POINT(P[1],P[2], "brown")
# r: C1[1],C1[2] - C2[1],C2[2]
# s: C1[1]-R1,C1[2] - C2[1]-R2,C2[2]
# t: tangent in Q passing through P
  
line_line(C1[1],C1[2],C3[1],C3[2], C1[1]-R1,C1[2],C3[1]-R3,C3[2]) P2 = c(solut[1],solut[2]); Q2 = P_tan(P2[1],P2[2], C1[1],C1[2], R1) l2p(Q2[1],Q2[2], P2[1],P2[2], "seagreen"); l2p(Q2[3],Q2[4], P2[1],P2[2], "seagreen") POINT(P2[1],P2[2], "brown") line_line(C2[1],C2[2],C3[1],C3[2], C2[1]-R2,C2[2],C3[1]-R3,C3[2]) P3 = c(solut[1],solut[2]); Q3 = P_tan(P3[1],P3[2], C3[1],C3[2], R3) l2p(Q3[1],Q3[2], P3[1],P3[2], "seagreen"); l2p(Q3[3],Q3[4], P3[1],P3[2], "seagreen") POINT(P3[1],P3[2], "brown") l2p(P3[1],P3[2], P[1],P[2], "red") # # Another case: PLANE(-3,16,-1,18) C1=c(1,3); R1=3; C2=c(9,5.5); R2=1; C3=c(6,8); R3=2 ...