mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
Add tikz/triangle-unit-circle
This commit is contained in:
parent
50f80fd98c
commit
f40aea745e
4 changed files with 84 additions and 0 deletions
33
tikz/triangle-unit-circle/Makefile
Normal file
33
tikz/triangle-unit-circle/Makefile
Normal file
|
@ -0,0 +1,33 @@
|
|||
SOURCE = triangle-unit-circle
|
||||
DELAY = 80
|
||||
DENSITY = 300
|
||||
WIDTH = 512
|
||||
|
||||
make:
|
||||
pdflatex $(SOURCE).tex -output-format=pdf
|
||||
make clean
|
||||
|
||||
clean:
|
||||
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
|
||||
|
||||
gif:
|
||||
pdfcrop $(SOURCE).pdf
|
||||
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
|
||||
make clean
|
||||
|
||||
png:
|
||||
make
|
||||
make svg
|
||||
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
|
||||
|
||||
transparentGif:
|
||||
convert $(SOURCE).pdf -transparent white result.gif
|
||||
make clean
|
||||
|
||||
svg:
|
||||
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
||||
pdf2svg $(SOURCE).pdf $(SOURCE)1.svg
|
||||
# Necessary, as pdf2svg does not always create valid svgs:
|
||||
inkscape $(SOURCE)1.svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
|
||||
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
|
||||
rm $(SOURCE)1.svg
|
3
tikz/triangle-unit-circle/README.md
Normal file
3
tikz/triangle-unit-circle/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
Compiled example
|
||||
----------------
|
||||

|
BIN
tikz/triangle-unit-circle/triangle-unit-circle.png
Normal file
BIN
tikz/triangle-unit-circle/triangle-unit-circle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
48
tikz/triangle-unit-circle/triangle-unit-circle.tex
Normal file
48
tikz/triangle-unit-circle/triangle-unit-circle.tex
Normal file
|
@ -0,0 +1,48 @@
|
|||
\documentclass{article}
|
||||
\usepackage[pdftex,active,tightpage]{preview}
|
||||
\setlength\PreviewBorder{2mm}
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{backgrounds}
|
||||
\usepackage{tkz-euclide}
|
||||
\usetikzlibrary{angles,quotes}
|
||||
|
||||
\usetkzobj{all}
|
||||
\usetikzlibrary{shapes, calc, decorations}
|
||||
\usepackage{amsmath,amssymb}
|
||||
\usepackage{helvet}
|
||||
\usepackage[eulergreek]{sansmath}
|
||||
|
||||
\begin{document}
|
||||
\begin{preview}
|
||||
\begin{tikzpicture}[very thick,font=\sansmath\sffamily,x=3cm,y=3cm, show background rectangle,
|
||||
background rectangle/.style={fill=white},]
|
||||
\tkzInit[xmax=1.0,ymax=1.0,xmin=-1.0,ymin=-1.0]
|
||||
\tkzGrid
|
||||
\tkzAxeXY[up space=0.2,right space=0.2,fill=none]
|
||||
|
||||
\tkzDefPoint(0,0){A}
|
||||
\tkzDefPoint({cos(FPpi/5)*1},0){B}
|
||||
\tkzDefPoint({cos(FPpi/5)*1},{sin(FPpi/5)*1}){C}
|
||||
\tkzDefPoint(1,0){CircleEnd}
|
||||
|
||||
\tkzDrawCircle(A,CircleEnd)
|
||||
|
||||
% \tkzLabelPoints[below left,font=\sansmath\sffamily](A)
|
||||
% \tkzLabelPoints[below right,font=\sansmath\sffamily](B)
|
||||
|
||||
% Mark angle
|
||||
\tkzMarkAngle[arc=l,size=0.6cm,fill=green!30](B,A,C)
|
||||
\tkzLabelAngle[pos=0.15](B,A,C){$\alpha$}
|
||||
|
||||
% Draw polygon
|
||||
\tkzDrawPolygon(A,B,C)
|
||||
\tkzDrawSegment[black!60!green,very thick](A,B)
|
||||
\tkzDrawSegment[red,very thick](B,C)
|
||||
|
||||
% Label lines
|
||||
\tkzLabelSegment[above](A,C){$1$}
|
||||
\tkzLabelSegment[sloped,above=-0.05,red](B,C){$\sin(\alpha)$}
|
||||
\tkzLabelSegment[below,black!60!green](A,B){$\cos(\alpha)$}
|
||||
\end{tikzpicture}
|
||||
\end{preview}
|
||||
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue