Draw Arc Circle Three Points Tikzpicture
Introduction
TichiliadZ is probably the almost complex and powerful tool to create graphic elements in LaTdue eastX. Starting with a elementary case, this article introduces some basic concepts: drawing lines, dots, curves, circles, rectangles etc.
Firstly, load the tikz
package by including the line \usepackage{tikz}
in the preamble of your certificate, then draw a graphic using the tikzpicture
environment.
\documentclass {article} \usepackage {tikz} \begin {document} \begin {tikzpicture} \draw [gray, thick] (-1,2) -- (2,-four); \draw [gray, thick] (-i,-ane) -- (ii,2); \filldraw [black] (0,0) circle (2pt) node[anchor=west]{Intersection point}; \end {tikzpicture} \end {document}
Open this instance in Overleaf
This example produces the following output:
In this example two lines and one point are fatigued. To add together a line the command \draw[greyness, thick]
defines a graphic element whose colour is grayness
and with a thick
stroke. The line is really defined by it'due south 2 endpoints, (-one,2)
and (2,-iv)
, joined by --
.
The point is actually a circle
drawn by \filldraw[blackness]
, this command will non only draw the circle but fill information technology using black. In this command the middle bespeak (0,0)
and the radius (2pt)
are declared. Next to the bespeak is a node
, which is really a box containing the text intersection point
, and anchored at the west
of the point.
Information technology's important to find the semicolon ;
used at the end of each draw
command.
Note: The tikzfigure
surround can exist enclosed inside a figure or similar environment. Run across the Inserting Images article for more information on this topic.
Bones elements: points, lines and paths
In this section we provide some examples showing how to create some bones graphic elements which tin exist combined to create more than elaborate figures.
\documentclass {article} \usepackage {tikz} \begin {document} \begin {tikzpicture} \draw (-2,0) -- (2,0); \filldraw [gray] (0,0) circle (2pt); \describe (-2,-2) .. controls (0,0) .. (2,-2); \draw (-2,2) .. controls (-ane,0) and (1,0) .. (two,two); \terminate {tikzpicture} \cease {document}
Open up this case in Overleaf
This instance produces the following output:
There are three basic commands in this case:
-
\draw (-two,0) -- (2,0);
: This defines a line whose endpoint are(-two,0)
and(2,0)
. -
\filldraw [gray] (0,0) circle (2pt);
: The signal is created equally a very pocket-sizegreyness
circle
centred at(0,0)
and whose radius is(2pt)
. The\filldraw
command is used to draw elements and fill them with a specific colour. Come across the side by side section for more examples. -
\draw (-two,2) .. controls (-1,0) and (ane,0) .. (2,two);
: Draws a Bézier bend. In that location are 4 points defining information technology:(-2,2)
and(two,ii)
are its endpoints,(-1,0)
and(ane,0)
are control points that make up one's mind "how curved" information technology is. You tin can recollect of these two points as "attractor points".
Basic geometric shapes: Circles, ellipses and polygons
Geometric figures can be constructed from simpler elements so let's start with circles, ellipses and arcs.
\documentclass {article} \usepackage {tikz} \brainstorm {document} \begin {tikzpicture} \filldraw [colour=red!60, fill=carmine!v, very thick](-one,0) circumvolve (ane.5); \make full [bluish!50] (2.5,0) ellipse (one.5 and 0.5); \draw [ultra thick, ->] (6.5,0) arc (0:220:1); \end {tikzpicture} \end {document}
Open up this example in Overleaf
This example produces the following output:
-
\filldraw[color=cerise!sixty, fill=red!5, very thick](-ane,0) circle (i.5);
: This command was used in the previous section to depict a bespeak, simply in this instance there are some boosted parameters inside the brackets. These are explained below:-
color=blood-red!60
: The colour of the ring around the circle is set to 60% red (lighter than "pure" reddish). See the reference guide for a listing of the default colours available in LaTeTen; as well, see Using colours in LaTeX to learn how to create your own colours. -
fill=ruddy!5
: The circle is filled with an even lighter shade of red. -
very thick
: This parameter defines the thickness of the stroke. See the reference guide for a consummate list of values.
-
-
\fill[blue!50] (2.5,0) ellipse (1.5 and 0.5);
: To create an ellipse you lot provide a heart bespeak(2.5,0)
, and two radii: horizontal and vertical (one.5
and0.v
respectively). As well discover the commandmake full
instead ofdraw
or filldraw, this is because, in this case, in that location's no need to control outer and inner colours. -
\describe[ultra thick, ->] (six.five,0) arc (0:220:i);
: This command volition draw an arc starting at(vi.5,0)
. The actress parameter->
indicates that the arc will take an arrow at the terminate. In improver to the starting signal you must provide three additional values: the starting and catastrophe angles, and the radius; here, these 3 parameter values are provided in the format(0:220:one)
.
In improver to curved geometric shapes y'all can also create elements that use straight lines, using a similar syntax:
\documentclass {article} \usepackage {tikz} \brainstorm {document} \begin {tikzpicture} \draw [bluish, very thick] (0,0) rectangle (iii,2); \describe [orange, ultra thick] (4,0) -- (6,0) -- (v.7,2) -- cycle; \end {tikzpicture} \end {document}
Open up this example in Overleaf
This example produces the following output:
-
\draw[blueish, very thick] (0,0) rectangle (3,2);
: Rectangles are created by the special controlrectangle
. You have to provide two points, the commencement one is where the "pencil" begins to draw the rectangle and the 2d ane is the diagonally contrary corner bespeak. -
\draw[orange, ultra thick] (4,0) -- (six,0) -- (5.7,2) -- bike;
: To draw a polygon we draw a airtight path of straight lines: a line from(4,0)
to(6,0)
and a line from(6,0)
to(5.7,2)
. Thebicycle
instruction means that the start and end points should coincide to create a "closed" path (shape), which results in construction of the final line segment.
Diagrams
Nodes are probably the well-nigh versatile elements in TikZ. Nosotros've already used i node in the introduction—to add some text to the figure. The side by side example uses nodes to create a diagram.
\documentclass {article} \usepackage {tikz} \usetikzlibrary {positioning} \begin {document} \begin {tikzpicture}[ roundnode/.manner={circumvolve, draw=green!threescore, fill=dark-green!5, very thick, minimum size=7mm}, squarednode/.style={rectangle, draw=red!60, fill=scarlet!5, very thick, minimum size=5mm}, ] %Nodes \node [squarednode] (maintopic) {2}; \node [roundnode] (uppercircle) [higher up=of maintopic] {ane}; \node [squarednode] (rightsquare) [right=of maintopic] {3}; \node [roundnode] (lowercircle) [beneath=of maintopic] {iv}; %Lines \draw [->] (uppercircle.south) -- (maintopic.due north); \draw [->] (maintopic.east) -- (rightsquare.west); \describe [->] (rightsquare.due south) .. controls +(down:7mm) and +(right:7mm) .. (lowercircle.e); \end {tikzpicture} \finish {certificate}
Open this example in Overleaf
This case produces the following output:
There are essentially three commands in this effigy: A node definition, a node declaration and lines that join two nodes.
-
roundnode/.style={circumvolve, depict=green!lx, fill=light-green!v, very thick, minimum size=7mm}
: Passed as a parameter to thetikzpicture
environs. It defines a node that volition be referenced asroundnode
: this node will be a circle whose outer ring will be drawn using the colourgreen!sixty
and will be filled usinggreen!5
. The stroke volition existvery thick
and itsminimum size
is7mm
. The line below this defines a 2d rectangle-shaped node chosensquarednode
, using similar parameters. -
\node[squarednode] (maintopic) {two};
: This will create asquarednode
, equally defined in the previous command. This node will have an id ofmaintopic
and will contain the number2
. If you go out an empty space inside the braces no text volition be displayed. -
[above=of maintopic]
: Notice that all but the starting time node have an additional parameter that determines its position relative to other nodes. For instance,[above=of maintopic]
means that this node should announced higher up the node namedmaintopic
. For this positioning system to work you have to add\usetikzlibrary{positioning}
to your preamble. Without thepositioning
library, you can use the syntaxabove of=maintopic
instead, only thepositioning
syntax is more flexible and powerful: you can extend it to writeabove=3cm of maintopic
i.e. control the actual distance frommaintopic
. -
\draw[->] (uppercircle.south) -- (maintopic.north);
: An arrow-like straight line volition be drawn. The syntax has been already explained in the basic elements department. The only deviation is the way in which we write the endpoints of the line: by referencing a node (this is why nosotros named them) and a position relative to the node.
Reference Guide
Possible color and thickness parameters in the tikz
packet:
parameter | values | picture |
---|---|---|
color | white, black, red, green, blue, cyan, magenta, yellow | ![]() |
thickness | ultra thin, very thin, thin, thick, very thick, ultra thick | ![]() |
More colours may be available in your LaTe10 distribution. See Using colours in LaTeX
Further reading
For more than information run across:
- Using colours in LaTeX
- Pgfplots package
- Inserting Images
- Lists of tables and figures
- Positioning images and tables
- Cartoon diagrams directly in LaTeX
- The TikZ and PGF Packages Manual
- TikZ and PGF examples at TeXample.net
Source: https://www.overleaf.com/learn/latex/TikZ_package
0 Response to "Draw Arc Circle Three Points Tikzpicture"
Postar um comentário