This question may seem repetitive to many, but as I am very new to Latex, even after reading many posts, could not get to draw what I wanted, so asking.
I want to draw as the following.
I have written the following code, Please help further.
\documentclass[11pt, oneside]{article}
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
\geometry{landscape}
\usepackage{tikz} % TeX will automatically convert eps --> pdf in pdflatex
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{gensymb}
\usepackage{tkz-euclide}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{calc}
\usepackage{graphicx}
\usetikzlibrary{plotmarks}
\title{}
\author{}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle(2) node [left] {P};
\draw (3.5,0) circle(1.5) node [below] {Q};
\draw (0,0) -- (14,0) node [right] {O};
\newcommand*{\Radius}{2cm}%
\coordinate (Origin) at (0,0);
\coordinate (O) at (14,0);% External point
\tkzDrawCircle[R](Origin,\Radius)
\tkzTangent[from with R= O](Origin,\Radius) \tkzGetPoints{R}{I}
\tkzDrawSegments[ultra thick](O,R)% First tangent
\tkzDrawSegments[ultra thick](O,I)% Second tangent
\end{tikzpicture}
\end{document}
Best Answer
I give my personal answer because It's preferable to avoid to mix syntaxes ( tikz and euclide ) and I added some remarks. I take big parts from hpesoj626's answer.
Firstly, I prefer to use several parts in my code, I created tkz-euclide to do this: definition, calculations, drawings and labels. If you study tikz enough, you will be able to use only tikz and to put tkz-euclide in the trash.
Remarks about definitions
coordinate
here from tikz but if you use another system of coordinates from tkz then you can go down some complications.\pgfmathsetmacro
is moretikzien
but you need to add the unity afterRemarks about calculations : none it's fine
Remarks about drawings :
\tkzDrawSegment
and\tkzDrawSegments
. The second is to draw several objects with the same options but if you need specific options, then you need to use the first form.add
. I added to tkz-euclide the possibility to use tikz option but I added somme specific option that I created. You can useadd = n and m
to extend a line (n and m are a percent of the length of the line. I prefer this possibility because it's easy to add half of a line or to double the line.Remarks about labels :
The same remarks about the pair of macros. You can add labels with general options or with specific ones.
Conclusion tkz-euclide is useful only if you need to draw several pictures and if you want to write rapidly your code but for one picture, I think it's preferable to study tikz. With tkz-euclide you need to know some options from tikz.
So a tkz-euclide solution is