Hình bên dưới được vẽ bằng TikZ, một thư viện vẽ hình của LaTeX.
$$ \usetikzlibrary{calc} \foreach \i in{0}{ \begin{tikzpicture}[font=\footnotesize, line join=round, line cap=round, >=stealth] \tikzset{Icon-Tau/.pic={ \fill[ball color=brown!80!cyan!80!white](-4.65,0.08)..controls+(-23:2.5) and+(-165:3.5)..(4.6,0)..controls+(15:0.15) and+(-15:0.5)..(3.9,0.2)..controls+(-172:5) and+(15:2)..(-4.65,0.08); %%Thành trong tầu \fill[ball color=gray!10!cyan] [red](-4.65,0.08)--+(-25:0.4)..controls+(10:2) and++(-172:5)..(3.8,0)--++(110:0.2)..controls+(-172:5) and+(15:2)..(-4.65,0.08); %%Trung tâm tàu \fill[ball color=gray!20](-0.25,-0.42)--++(48:1)coordinate(x)--++(-5:0.85)coordinate(y)--++(-112:1.1)coordinate(z)--cycle; \fill[ball color=gray!10](x)--(y)--++(0:0.5)coordinate(t)--++(170:1)coordinate(u)--++(180:0.2)--cycle; \fill[cyan](t)--++(72:0.7)coordinate(a)--++(175:0.85)coordinate(b)--(u)--cycle; \fill[ball color=gray!20!green](a)--++(2:1.2)coordinate(c)--++(165:0.6)--++(-178:1.25)--(b)--cycle; \fill[ball color=gray!20](z)--(y)--(t)--(a)--(c)--++(-70:0.4)coordinate(d)--++(2:0.5)coordinate(e)--++(-80:1)--cycle ($(d)!0.5!(c)$)coordinate(m); \fill[ball color=gray!20,draw=gray](d)--(e)--(m)--cycle; %%Hét trung tâm tàu \fill[ball color=gray!90!cyan](-4.65,0.08)..controls+(-23:2.5) and+(-165:3.5)..(4.6,0)..controls+(15:0.05) and++(65:1.2)..(4.2,-1)..controls++(-152:0.75) and+(13:2)..(-1,-2.5)..controls++(-167:1.1) and+(-50:3.5)..(-4.65,0.08); \fill[ball color=gray!30!white](2,1.5)--++(80:2)arc(-95:-450:1 and 0.1)--++(-92:2)--cycle; \fill[ball color=gray!90!cyan](2,1)coordinate(e)--++(0:0.4)--++(88:0.65)--++(175:0.3)coordinate(f)--cycle; \fill[ball color=gray!90!cyan](e)--(f)--++(180:0.2)--++(-115:0.7)--cycle; \clip (-4.65,0.08)..controls+(-23:2.5) and+(-165:3.5)..(4.6,0)..controls+(15:0.05) and++(65:1.2)..(4.2,-1)..controls++(-152:0.75) and+(13:2)..(-1,-2.5)..controls++(-167:1.1) and+(-50:3.5)..(-4.65,0.08); \fill[red](-4,-0.7)..controls++(-30:2) and++(-160:3)..(4.5,-0.3)--++(-90:0.25)..controls++(-160:3) and++(-25:1.5)..(-3.6,-1.1); }} \pgfmathsetmacro{\k}{int(mod(\i,2))} \ifnum \k=0 \path(0,0)pic{Icon-Tau}; \fill[ball color=orange,rotate around ={-20:(-3.8,-0.6)}](-3.8,-0.6)arc(220:580:0.35 and 0.1); \else \path(0,0)pic{Icon-Tau}; \fill[ball color=black,rotate around ={-20:(-3.8,-0.6)}](-3.8,-0.6)arc(220:580:0.35 and 0.1); \fi \end{tikzpicture} } $$
$$ \begin{tikzpicture}%[green] \tikzset{thuyen/.pic={ \fill[red](-0.36,3.8)--++(180:2)--(-0.36,4.5)--cycle; \draw[orange,line width=2pt](-0.4,-3.2)--++(90:7.8); \fill[ball color=orange!60!black](-3.9,-4.35)--(2.75,-4.35)--++(43:1.4)--++(182:8.1)--cycle; \fill[ball color=yellow](-4.5,-3.55)--++(1.8:8.75)--++(65:0.7)--++(184.2:9.1)--cycle; \fill(-4.2,-3.3)..controls++(45:2.5) and++(-108:3)..(-0.45,2.7)..controls++(-95:2) and++(100:2)..(-0.45,-2.6); \fill[ball color=teal!50!green](-0.4,-2.6)..controls++(20:1) and++(160:2)..(3.75,-2.7)..controls++(105:3.25) and++(-35:2)..(-0.4,3.65)..controls++(-65:2) and++(65:2)..(-0.4,-2.6); }} \path(0,0)pic[scale=0.5,blue]{thuyen}; \end{tikzpicture} $$
Xem code nguồn của trang này để lấy mã TikZ (nhấp phải chuột chọn "View page source").
0 Nhận xét