use library calc tikz in IPE
Tony via Ipe-discuss <ipe-discuss-rGrgPyRx506NN8uzcEdRPYRWq/[email protected]> Sun, 5 May 2019 20:43:23 +0200
| Newsgroups | gmane.comp.graphics.ipe.general |
|---|---|
| Message-ID | <CAKs4j8o0VRn1MUXMbm8A5YbUGt12pW28NL1MHLyt=eXQbE3Q3Q@mail.gmail.com> |
--===============4603061540533236838==
Content-Type: multipart/alternative; boundary="000000000000395d610588285ce6"
--000000000000395d610588285ce6
Content-Type: text/plain; charset="UTF-8"
I would like to use some libraries du ipe to be able to draw simple
functions. in order to do this, you need to implement the TIKZ package with
the calc library.
Using Textstudio I can write this, getting a certain result (you can
compile to verify).
*\documentclass{article}\usepackage{tikz}\usetikzlibrary{calc}\usetikzlibrary{backgrounds}\begin{document}
\begin{tikzpicture}[scale=1.5,velocity/.style=
{thick,blue!15!black},terr/.style= {thick,gray!60}]]\fill[terr] (-2,0)
rectangle (3,-0.5);\draw [thick, black,->] (-2,0)--(3,0) node[right, below]
{$x$};\draw [thick,black,->] (0,0)--(0,3.5) node[above, left] {$z$};\draw
[very thick,black] (-1.5,0)--(-1.5,2.7) node[above, above] {};\fill[terr]
(2.25,0) rectangle (2.15,3.5);\draw [very thick,black] (2.15,0)--(2.15,3.5)
node[above, above] {};\draw[thick,velocity] plot[domain=0:15] ({ 0},{
(.2*\x)});\foreach \i in {1,2,...,14}{ \draw[velocity,-latex] ($(-1.5,0)
+ {.2*(\i-0.5)}*(0,1)$) --++ (1,0);}\draw[-] plot[domain=0:15] ({ 0},{
(0.2*\x)});\foreach \i in {1,2,...,35}{ \draw[rotate = 0,velocity,-]
($(2.15,0) + {.1*(\i-0.5)}*(0,1)$) --++ (0.1,0);}*
*\draw[thick,velocity] plot[domain=0:15] ( {(2*(1-exp(-\x/2)))*cos(5) +
(0.1*\x)*(sin(5))}, {-0*tan(5) + (-2*(1-exp(-\x/2)))*sin(5) +
(.2*\x)*cos(5)});\foreach \i in {1,2,...,14}{ \draw[velocity,-latex]
(${-sin(5)*1*(\i-0.5)}*(0.01,0) + {cos(5)*.2*(\i-0.5)}*(0,1)$) -- ++
(${2.1*(1-exp(-(\i-0.5)/2))*cos(5)}*(1,0)$);}%%-----------Altro modo
rettangolo% \begin{scope}[on background layer]% \path[fill=gray!60]
plot[smooth,domain=0:4] (2.3,3.5) coordinate (1,1)-- (2.15,3.5)|-
(2.3,0);% \end{scope}%%--------------------------------% \node[] at
(-1,2.9) {$U_\infty$};% \node[draw=black,fill=white] at (1.1,2.1)
{$\bar{u}$};% %\node[] at (0.2,-0.15) {$0$};
\end{tikzpicture}\end{document}*
When I implement this on IPE (using the ipelet tikz) I can't get the
function to draw, because the calc library is essential. how should it be
implemented in the preamble? or in the sty file?
Thanks
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Mail
priva di virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
--000000000000395d610588285ce6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div dir=3D"ltr"><div><br></div><div>
<span class=3D"gmail-tlid-translation gmail-translation" lang=3D"en"><span =
title=3D"">I would like to use some libraries du ipe to be able to draw sim=
ple functions.</span> <span title=3D"" class=3D"gmail-">in order to do this=
, you need to implement the TIKZ package with the calc library.</span><br><=
span title=3D"" class=3D"gmail-">Using Textstudio I can write this, getting=
a certain result (you can compile to verify).</span></span></div><div><b>\=
documentclass{article}<br>\usepackage{tikz}<br>\usetikzlibrary{calc}<br>\us=
etikzlibrary{backgrounds}<br><br>\begin{document}<br>=C2=A0=C2=A0=C2=A0 \be=
gin{tikzpicture}[scale=3D1.5,<br>velocity/.style=3D {thick,blue!15!black},<=
br>terr/.style=3D {thick,gray!60}]<br>]<br>\fill[terr] (-2,0) rectangle (3,=
-0.5);<br>\draw [thick, black,->] (-2,0)--(3,0) node[right, below] {$x$}=
;<br>\draw [thick,black,->] (0,0)--(0,3.5) node[above, left] {$z$};<br>\=
draw [very thick,black] (-1.5,0)--(-1.5,2.7) node[above, above] {};<br>\fil=
l[terr] (2.25,0) rectangle (2.15,3.5);<br>\draw [very thick,black] (2.15,0)=
--(2.15,3.5) node[above, above] {};<br><br>\draw[thick,velocity] plot[domai=
n=3D0:15] ({ 0},{ (.2*\x)});<br>\foreach \i in {1,2,...,14}<br>{<br>=C2=A0=
=C2=A0=C2=A0 \draw[velocity,-latex] ($(-1.5,0) + {.2*(\i-0.5)}*(0,1)$) --++=
(1,0);<br>}<br><br>\draw[-] plot[domain=3D0:15] ({ 0},{ (0.2*\x)});<br>\fo=
reach \i in {1,2,...,35}<br>{<br>=C2=A0=C2=A0=C2=A0 \draw[rotate =3D 0,velo=
city,-] ($(2.15,0) + {.1*(\i-0.5)}*(0,1)$) --++ (0.1,0);<br>}<br></b></div>=
<div><b><br></b></div><div><b>\draw[thick,velocity] plot[domain=3D0:15] ( {=
(2*(1-exp(-\x/2)))*cos(5) + (0.1*\x)*(sin(5))},<br>=C2=A0=C2=A0=C2=A0 {-0*t=
an(5) + (-2*(1-exp(-\x/2)))*sin(5) + (.2*\x)*cos(5)});<br>\foreach \i in {1=
,2,...,14}<br>{<br>=C2=A0=C2=A0=C2=A0 \draw[velocity,-latex] (${-sin(5)*1*(=
\i-0.5)}*(0.01,0) + {cos(5)*.2*(\i-0.5)}*(0,1)$) --<br>=C2=A0=C2=A0=C2=A0 +=
+ (${2.1*(1-exp(-(\i-0.5)/2))*cos(5)}*(1,0)$);<br>}<br>%%-----------Altro m=
odo rettangolo<br>%=C2=A0=C2=A0=C2=A0 \begin{scope}[on background layer]<br=
>%=C2=A0=C2=A0=C2=A0 \path[fill=3Dgray!60] plot[smooth,domain=3D0:4] (2.3,3=
.5) coordinate (1,1)-- (2.15,3.5)|- (2.3,0);<br>%=C2=A0=C2=A0=C2=A0 \end{sc=
ope}<br>%%--------------------------------<br><br>%=C2=A0=C2=A0=C2=A0 \node=
[] at (-1,2.9) {$U_\infty$};<br>%=C2=A0=C2=A0=C2=A0 \node[draw=3Dblack,fill=
=3Dwhite] at (1.1,2.1) {$\bar{u}$};<br>%=C2=A0=C2=A0=C2=A0 %\node[] at (0.2=
,-0.15) {$0$};<br>=C2=A0=C2=A0=C2=A0 \end{tikzpicture}<br>\end{document}</b=
><br><span class=3D"gmail-tlid-translation gmail-translation" lang=3D"en"><=
/span></div><div><span class=3D"gmail-tlid-translation gmail-translation" l=
ang=3D"en"><span title=3D"" class=3D"gmail-"><br></span></span></div><div><=
span class=3D"gmail-tlid-translation gmail-translation" lang=3D"en"><span t=
itle=3D"" class=3D"gmail-">When I implement this on IPE (using the ipelet t=
ikz) I can't get the function to draw, because the calc library is esse=
ntial.</span> <span title=3D"">how should it be implemented in the preamble=
?</span> <span title=3D"" class=3D"gmail-">or in the sty file?</span></span=
></div><div><span class=3D"gmail-tlid-translation gmail-translation" lang=
=3D"en"><span title=3D"" class=3D"gmail-"><br></span></span></div><div><spa=
n class=3D"gmail-tlid-translation gmail-translation" lang=3D"en"><span titl=
e=3D"" class=3D"gmail-">Thanks<br></span></span>
</div></div></div><div id=3D"DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <ta=
ble style=3D"border-top:1px solid #d3d4de">
<tr>
<td style=3D"width:55px;padding-top:18px"><a href=3D"https://www.avas=
t.com/sig-email?utm_medium=3Demail&utm_source=3Dlink&utm_campaign=
=3Dsig-email&utm_content=3Dwebmail" target=3D"_blank"><img src=3D"https=
://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-n=
o-repeat-v1.gif" alt=3D"" width=3D"46" height=3D"29" style=3D"width: 46px; =
height: 29px;"></a></td>
<td style=3D"width:470px;padding-top:17px;color:#41424e;font-size:13px;fo=
nt-family:Arial,Helvetica,sans-serif;line-height:18px">Mail priva di virus.=
<a href=3D"https://www.avast.com/sig-email?utm_medium=3Demail&utm_sour=
ce=3Dlink&utm_campaign=3Dsig-email&utm_content=3Dwebmail" target=3D=
"_blank" style=3D"color:#4453ea">www.avast.com</a> </td>
</tr>
</table>
<a href=3D"#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width=3D"1" height=3D"1">=
</a></div>
--000000000000395d610588285ce6--
--===============4603061540533236838==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Ipe-discuss mailing list
Ipe-discuss-rGrgPyRx506NN8uzcEdRPYRWq/[email protected]
https://mailman.science.uu.nl/mailman/listinfo/ipe-discuss
--===============4603061540533236838==--