mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
added imagry
This commit is contained in:
parent
45bd4d008b
commit
18ef6101a7
5 changed files with 103 additions and 6 deletions
|
@ -4,6 +4,7 @@ DENSITY = 300
|
|||
WIDTH = 512
|
||||
|
||||
make:
|
||||
make clean
|
||||
pdflatex $(SOURCE).tex -output-format=pdf
|
||||
asy $(SOURCE)-*.asy
|
||||
asy $(SOURCE)-*.asy
|
||||
|
@ -11,7 +12,7 @@ make:
|
|||
make clean
|
||||
|
||||
clean:
|
||||
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot *.out *.prc *.pre *.asy
|
||||
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot *.out *.prc *.pre *.asy topology-r-spiral-covering-s-1_0.pdf topology-r-spiral-covering-s-1+0_0.pdf topology-r-spiral-covering-s-1.tex
|
||||
|
||||
gif:
|
||||
pdfcrop $(SOURCE).pdf
|
||||
|
|
|
@ -26,8 +26,10 @@ real phix = 0.1;
|
|||
real phim = 6.7;
|
||||
|
||||
// spiral
|
||||
path3 spiral = graph(x,y,z,1,phim,operator ..);
|
||||
draw(spiral,Arrow3);
|
||||
path3 spiral1 = graph(x,y,z,0.9,1,operator ..);
|
||||
draw(spiral1,dotted);
|
||||
path3 spiral2 = graph(x,y,z,1,phim,operator ..);
|
||||
draw(spiral2,Arrow3);
|
||||
|
||||
// blue circle
|
||||
draw(unitcircle3, blue);
|
||||
|
@ -46,9 +48,9 @@ dot(px);
|
|||
label("$x$",px,S);
|
||||
|
||||
// axes and labels
|
||||
xaxis3("",red);
|
||||
yaxis3("",red);
|
||||
zaxis3("",red);
|
||||
xaxis3("",red,Arrow3);
|
||||
yaxis3("",red,Arrow3);
|
||||
zaxis3("",red,Arrow3);
|
||||
|
||||
label("$\mathbb{R}$",(1,-1,4));
|
||||
|
||||
|
|
35
asymptote/torus-three-paths/Makefile
Normal file
35
asymptote/torus-three-paths/Makefile
Normal file
|
@ -0,0 +1,35 @@
|
|||
SOURCE = torus-three-paths
|
||||
DELAY = 80
|
||||
DENSITY = 300
|
||||
WIDTH = 512
|
||||
|
||||
make:
|
||||
make clean
|
||||
pdflatex $(SOURCE).tex -output-format=pdf
|
||||
asy $(SOURCE)-*.asy
|
||||
asy $(SOURCE)-*.asy
|
||||
pdflatex $(SOURCE).tex -output-format=pdf
|
||||
make clean
|
||||
|
||||
clean:
|
||||
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot *.out *.prc *.pre *.asy $(SOURCE)-1_0.pdf $(SOURCE)1+0_0.pdf $(SOURCE)-1.tex
|
||||
|
||||
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).svg
|
||||
# Necessary, as pdf2svg does not always create valid svgs:
|
||||
inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
|
8
asymptote/torus-three-paths/Readme.md
Normal file
8
asymptote/torus-three-paths/Readme.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
Compiled example
|
||||
----------------
|
||||

|
||||
|
||||
Credits
|
||||
-------
|
||||
|
||||
This graph was created by [Alex](http://tex.stackexchange.com/users/22467/alex) ([source](http://tex.stackexchange.com/a/149706/5645))
|
51
asymptote/torus-three-paths/torus-three-paths.tex
Normal file
51
asymptote/torus-three-paths/torus-three-paths.tex
Normal file
|
@ -0,0 +1,51 @@
|
|||
\documentclass[margin=1cm]{standalone}
|
||||
\usepackage{asymptote}
|
||||
\begin{document}
|
||||
\begin{asy}
|
||||
settings.render = 8;
|
||||
settings.prc = false;
|
||||
|
||||
import graph3;
|
||||
import contour;
|
||||
size3(8cm);
|
||||
|
||||
currentprojection = orthographic(10,1,4);
|
||||
defaultrender = render(merge = true);
|
||||
|
||||
// create torus as surface of rotation
|
||||
int umax = 40;
|
||||
int vmax = 40;
|
||||
surface torus = surface(Circle(c=2Y, r=0.6, normal=X, n=vmax), c=O, axis=Z, n=umax);
|
||||
torus.ucyclic(true);
|
||||
torus.vcyclic(true);
|
||||
|
||||
pen meshpen = 0.3pt + gray;
|
||||
|
||||
draw(torus, surfacepen=material(diffusepen=white+opacity(0.6), emissivepen=white));
|
||||
for (int u = 0; u < umax; ++u)
|
||||
draw(torus.uequals(u), p=meshpen);
|
||||
for (int v = 0; v < vmax; ++v)
|
||||
draw(graph(new triple(real u) {return torus.point(u,v); }, 0, umax, operator ..),
|
||||
p=meshpen);
|
||||
|
||||
pair a = (floor(umax/2) + 2, 3);
|
||||
dot(torus.point(a.x, a.y), L="$a$", align=W);
|
||||
pair b = (5, floor(vmax/2));
|
||||
dot(torus.point(b.x, b.y), L="$b$", align=2Z + X);
|
||||
|
||||
path3 abpath(int ucycles, int vcycles) {
|
||||
pair bshift = (ucycles*umax, vcycles*vmax);
|
||||
triple f(real t) {
|
||||
pair uv = (1-t)*a + t*(b+bshift);
|
||||
return torus.point(uv.x, uv.y);
|
||||
}
|
||||
return graph(f, 0, 1, operator ..);
|
||||
}
|
||||
|
||||
real linewidth = 0.8pt;
|
||||
|
||||
draw(abpath(0,0), p=linewidth + orange);
|
||||
draw(abpath(1,0), p=linewidth + red);
|
||||
draw(abpath(1,-1), p=linewidth + darkgreen);
|
||||
\end{asy}
|
||||
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue