|
SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br
|
|
Detetesto as vitimas
Quando elas respeitam os seus carrascos.
Jean Paul Sartre
|
Separation of the Plane in Moulton
%Point A
\tikzmath{\xa=-1;};
\tikzmath{\ya=-1;};
%Point B
\tikzmath{\xb= 1;};
\tikzmath{\yb= 1;};
%Left and right limit for x
\tikzmath{\xleft=-3;};
\tikzmath{\xright= 3;};
\input{/usr/local/tikz/Common.tikz}
\input{/usr/local/tikz/Moulton/Calc.Moulton.tikz}
\input{/usr/local/tikz/Moulton/Styles.tikz}
\tikzmath{\ybottom=\m*\xleft+\k;};
\tikzmath{\ytop= 3;};
\fill
[color=gray,opacity=0.1]
(0,\ytop)
--
(C)
--
(\xleft,\m*\xleft+\k)
--
(\xleft,\ytop)
--
cycle;
\fill
[color=gray,opacity=0.3]
(0,\ytop)
--
(C)
--
(\xright,0.5*\m*\xright+\k)
--
(\xright,\ytop)
--
cycle;
\fill
[color=gray,opacity=0.5]
(0,\ybottom)
--
(C)
--
(\xright,0.5*\m*\xright+\k)
--
(\xright,\ybottom)
--
cycle;
\fill
[color=gray,opacity=0.7]
(0,\ybottom)
--
(C)
--
(\xleft,\m*\xleft+\k)
--
(\xleft,\ybottom)
--
cycle;
\tikzmath{\xpos=0.5;};
\tikzmath{\ypos=0.65;};
\draw ($(\xpos*\xleft,\ypos*\ytop)$) node []{$A_1$};
\draw ($(\xpos*\xright,\ypos*\ytop)$) node []{$B_1$};
\tikzmath{\xpos=0.25;};
\tikzmath{\ypos=0.75;};
\draw ($(\xpos*\xleft, -\ypos*\ytop)$) node []{$A_2$};
\draw ($(\xpos*\xright,-\ypos*\ytop)$) node []{$B_2$};
\draw [-Latex] (\xleft,0) -- (\xright,0) node [right] {$x$};
\draw [-Latex] (0,\ybottom) -- (0,\ytop) node [above] {$y$};
\input{/usr/local/tikz/Moulton/Draw.Line.tikz}
\input{/usr/local/tikz/Moulton/Draw.ABC.tikz}
|
Showing: /usr/local/tikz/Moulton/Calc.Moulton.tikz:
TiKZ Listing: /usr/local/tikz/Moulton/Calc.Moulton.tikz.tex.
PDF
PNG
SVG
ZIP*
%Position of line titles
\tikzmath{\titlepos=-0.1;};
\tikzmath{\contpos=-0.2;};
\tikzmath{\contposleft=-0.5;};
\tikzmath{\contposright=-0.2;};
\tikzmath{\normalsize=1.5;};
\tikzmath{\tangentialfact=2.5;};
%Moulton parameters, y=\m*x+\k
\tikzmath{\m=(\yb-\ya)/(0.5*\xb-\xa);};
\tikzmath{\k=\ya-\m*\xa;};
%Nodes A, B and C
\coordinate (A) at ($(\xa,\ya)$);
\coordinate (B) at ($(\xb,\yb)$);
\coordinate (C) at ($(0,\k)$);
\coordinate (CX) at ($(-\k/\m,0)$);
%Points on left and right lines
\coordinate (CL) at ($(\xleft,\xleft*\m+\k)$);
\coordinate (CR) at ($(\xright,0.5*\xright*\m+\k)$);
\tikzmath{\x=\tangentialfact*\xleft;};
\coordinate (FCL) at ($(\x,\x*\m+\k)$);
\tikzmath{\x=\tangentialfact*\xright;};
\coordinate (FCR) at ($(\x,0.5*\x*\m+\k)$);
\coordinate (DL) at ($(\xleft,0.5*\xleft*\m+\k)$);
\coordinate (DR) at ($(\xright,\xright*\m+\k)$);
%Length to go along normals
\tikzmath{\LR=2;};
\tikzmath{\LL=2;};
%Length to go along normals for fills
\tikzmath{\FR=7;};
\tikzmath{\FL=7;};
%Unit normals
%Left normal is parallel to (-\m,1)
\tikzmath{\L=1/sqrt(1+\m*\m);};
\coordinate (NL) at ($\L*(-\m,1)$);
%Left normal is parallel to (-\m,2)
\tikzmath{\L=1/sqrt(4+\m*\m);};
\coordinate (NR) at ($\L*(-\m,2)$);
\input{/usr/local/tikz/Moulton/Calc.Left.tikz}
\input{/usr/local/tikz/Moulton/Calc.Right.tikz}
|
|
Messages:
0 secs.
|