Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{standalone}
- usepackage{tikz}
- begin{document}
- begin{tikzpicture}
- draw[fill] (0,0) circle (.5) -- ++(10:2) circle (.5) -- ++(-20:2) circle (.5);
- end{tikzpicture}
- end{document}
- documentclass{article}
- usepackage{tikz}
- begin{document}
- begin{tikzpicture}
- tikzset{bead/.style={circle,fill=black,inner sep=3pt}}
- draw node[bead] {} (0,0)
- foreach angle in {10,40,50,-50,0,150,30,-60,45,45,0}
- { -- ++(angle:1) node[bead] {}};
- end{tikzpicture}
- end{document}
- documentclass{article}
- usepackage{tikz}
- begin{document}
- begin{tikzpicture}
- tikzset{bead/.style={circle,fill=black,inner sep=3pt}}
- defangle{0}
- draw node[bead] {} (0,0)
- foreach stepangle[evaluate=stepangle as angle using angle+stepangle, remember=angle] in {10,20,-30,-60,135,-20,-30,0}
- { -- ++(angle:1) node[bead]{}};
- end{tikzpicture}
- end{document}
- size(300,300);
- real linkLen=1, linkWidth=2pt;
- real rl=2+linkLen; // distance between beads
- guide g=(1,0)--(1+linkLen,0); // a link
- pen beadColor=orange;
- pen linkColor=beadColor;
- void bead(transform t){
- draw(t*g,linkColor+linkWidth);
- radialshade(t*unitcircle,
- beadColor,shift(t)*(-0.4,0.3),0.01
- ,black,shift(t)*(-0.4,0.3),1.5);
- }
- pair operator>(pair pos=(0,0), real phi){
- transform t=shift(pos.x,pos.y)*rotate(phi);
- bead(t); // draw a bead with a link
- pos+=rl*(Cos(phi),Sin(phi)); // Sin, Cos - in degrees, sin, cos - in radians
- return pos;
- };
- pair pos=(0,0); // start point
- if(exp(1)>pi){ // note that ">" still works the usual way to compare numbers
- // this branch is skipped
- }else{
- pos=pos>0>45>-45>90>135; // draw a bead chain and update the position
- pos>0>45>-45>90>135; // continue the chain without updating the start position
- beadColor=lightyellow;
- linkColor=lightblue;
- pos>90>90>90; // draw another branch from saved position, with different colours
- }
- documentclass[10pt,a4paper]{article}
- usepackage{lmodern}
- usepackage{soul}
- usepackage{caption}
- usepackage[inline]{asymptote}
- defasydir{}
- begin{asydef}
- // Global Asymptote definitions
- real linkLen=1, linkWidth=2pt;
- real rl=2+linkLen; // distance between beads
- guide link=(1,0)--(1+linkLen,0); // a link
- pen beadColor=orange;
- pen linkColor=beadColor;
- void bead(transform t){
- draw(t*link,linkColor+linkWidth);
- radialshade(t*unitcircle,
- beadColor,shift(t)*(-0.4,0.3),0.01
- ,black,shift(t)*(-0.4,0.3),1.5);
- }
- pair operator>(pair pos=(0,0), real phi){
- transform t=shift(pos)*rotate(phi);
- bead(t); // draw a bead with a link
- pos+=rl*(Cos(phi),Sin(phi)); // Sin, Cos - in degrees, sin, cos - in radians
- return pos;
- };
- pair pos;
- end{asydef}
- begin{document}
- newcommandhi[1]{bf Hello st{Word} #1!}
- center
- captionof{figure}{Example of bead chain building.}
- begin{asy}
- size(150,150);
- pos>0>60>0>70;
- beadColor=lightyellow;
- pos>0>-60>0>-70;
- pos= pos>0>0>0>0;
- label("textbf{Example}",pos,SE);
- end{asy}
- center
- captionof{figure}{Another example of bead chain building.}
- begin{asy}
- size(150,150);
- beadColor=lightyellow;
- linkColor=lightblue;
- pos=pos>90>42>0>0>0>0>0>0>-130;
- label(
- "parbox{8cm}{"
- "The following command texttt{textbackslash hi} is defined \"
- +"in the main LaTeX document:\"
- "hi{LaTeX}}"
- ,pos);
- end{asy}
- end{document}
- sub asy {return system("asy '$_[0]'");}
- add_cus_dep("asy","eps",0,"asy");
- add_cus_dep("asy","pdf",0,"asy");
- add_cus_dep("asy","tex",0,"asy");
- documentclass[pstricks,border=12pt]{standalone}
- usepackage{pst-plot}
- defX(#1){#1}
- defY(#1){3+2*sin(#1)}
- psset{algebraic,showpoints,dotscale=3}
- begin{document}
- begin{pspicture}(-1,-1)(7,6)
- psparametricplot[plotpoints=10]{-0.5}{6.5}{X(t)|Y(t)}
- end{pspicture}
- end{document}
- end{document}
- documentclass[pstricks,border=12pt]{standalone}
- usepackage{pst-plot}
- defX(#1){#1}
- defY(#1){3+2*sin(#1)}
- psset{algebraic,showpoints,dotscale=3}
- begin{document}
- multido{i=2+1}{21}{%
- begin{pspicture}(-1,-1)(7,6)
- psparametricplot[plotpoints=i]{-0.5}{6.5}{X(t)|Y(t)}
- end{pspicture}}
- end{document}
- end{document}
- documentclass[pstricks,border=12pt]{standalone}
- usepackage{pstricks-add}
- begin{document}
- begin{pspicture}[showgrid](-1,-1)(8,3)
- psStartPoint(0,0)
- psforeach{i}{10,40,50,-50,0,150,30,-60,45,45,0}{psVector[arrows=-*](1;i)}
- end{pspicture}
- end{document}
- documentclass[pstricks,border=12pt]{standalone}
- usepackage{pst-node}
- begin{document}
- begin{pspicture}[showgrid](-1,-1)(8,3)
- pnode(0,0){A}
- psforeach{i}{10,40,50,-50,0,150,30,-60,45,45,0}{
- pnode[!1 ispace PtoC](A){B}
- pscircle*(B){4pt}
- psline(A)(B)
- pnode(B){A}
- }
- end{pspicture}
- end{document}
- draw (0,0) [turtle={beads, right=10, forward, left=20, forward, …}];
- draw (0,0) [turtle={beads,turn and step/.list={10,20,-30,-60,135,-20,-30,0}}] [bead];
- documentclass[tikz]{standalone}
- usetikzlibrary{turtle}
- tikzset{
- bead node/.style={circle,fill=black,inner sep=3pt},
- bead path/.style={to path={ [bead] -- (tikztotarget)}},
- bead/.style={insert path={node[bead node]{}}},
- turtle/beads/.style={how/.style={bead path},right},
- turtle/turn and step/.style={left=#1,forward}
- }
- begin{document}
- begin{tikzpicture}[turtle/distance=1cm]
- draw (0,0) [turtle={beads,turn and step/.list={10,20,-30,-60,135,-20,-30,0}}] [bead];
- end{tikzpicture}
- end{document}
- documentclass[margin=.25cm]{standalone}
- usepackage{tkz-graph}
- begin{document}
- begin{tikzpicture}
- GraphInit[vstyle=Art]% Init the graph and choice a style
- SetVertexNoLabel% no label
- Vertex{A}
- foreach a in {45,10,30,-20,0,-60,-40,-45,-10,-90,+20,0,60,-40}{%
- begin{scope}[shift=(A)]% polar from the last vertex
- Vertex[a=a , d=1 cm]{B}
- Edge[style={thick,double=black,double distance=1pt}](A)(B)
- pgfnoderename{A}{B}% rename the node, useful macro here
- end{scope}
- }
- end{tikzpicture}
- end{document}
- newcommand{newVertex}[1]{%
- begin{scope}[shift=(A)]
- Vertex[a=#1 , d=1 cm]{B}
- end{scope}
- }
- foreach a in {45,10,30,-20,0,-60,-40,-45,-10,-90,+20,0,60,-40}{%
- newVertex{a}
- Edge[style={thick,double=black,double distance=1pt}](A)(B)
- pgfnoderename{A}{B}
- }
Add Comment
Please, Sign In to add comment