mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-28 23:37:57 +02:00
added line segments
This commit is contained in:
parent
fdc5bb932f
commit
2d8eb1b0fe
17 changed files with 945 additions and 2 deletions
60
tikz/line-segments/line-segments-t5.tex
Normal file
60
tikz/line-segments/line-segments-t5.tex
Normal file
|
@ -0,0 +1,60 @@
|
|||
\documentclass{article}
|
||||
\usepackage{gensymb}
|
||||
\usepackage[pdftex,active,tightpage]{preview}
|
||||
\setlength\PreviewBorder{2mm}
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{arrows, calc, positioning,decorations.pathreplacing,shapes}
|
||||
\tikzset{
|
||||
%Define standard arrow tip
|
||||
>=stealth',
|
||||
% Define arrow style
|
||||
pil/.style={
|
||||
->,
|
||||
thick},
|
||||
line/.style={
|
||||
very thick,
|
||||
black,
|
||||
to path={% works only with "to" and not "--"
|
||||
-- (\tikztotarget) node[at start,point] {} node [at end,point] {} \tikztonodes
|
||||
}
|
||||
},
|
||||
point/.style={
|
||||
thick,
|
||||
draw=gray,
|
||||
cross out,
|
||||
inner sep=0pt,
|
||||
minimum width=4pt,
|
||||
minimum height=4pt,
|
||||
},
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
\begin{preview}
|
||||
\begin{tikzpicture}
|
||||
\newcommand\MinX{0}
|
||||
\newcommand\MinY{0}
|
||||
\newcommand\MaxX{5}
|
||||
\newcommand\MaxY{5}
|
||||
|
||||
% Coordinate system
|
||||
\draw [<->, thick, red] (0,{\MaxY+0.5}) -- (0,0) -- ({\MaxX+0.5},0);
|
||||
|
||||
\coordinate (A) at (5,5);
|
||||
\coordinate (B) at (0,0);
|
||||
\coordinate (C) at (1,1);
|
||||
\coordinate (D) at (3,3);
|
||||
|
||||
% \draw[color=orange, very thick, fill=orange!20] (A) -- (B) -- cycle;
|
||||
|
||||
\draw[line, red] (A) -- (B);
|
||||
\draw[line, blue] (C) -- (D);
|
||||
|
||||
\draw[step=0.5cm,color=gray] ({\MinX-0.25}, {\MinY-0.25}) grid ({\MaxX+0.25},{\MaxY+0.25});
|
||||
\path[every node/.style={point}]
|
||||
node at (A) {}
|
||||
node at (B) {}
|
||||
node at (C) {}
|
||||
node at (D) {};
|
||||
\end{tikzpicture}
|
||||
\end{preview}
|
||||
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue