Materi ini memang bukan bidang kajian saya. Pada tulisan ini saya hanya ingin menunjukkan bagian lain dari sumberdaya $\LaTeX$.
Paket tikz sungguh sangat menarik dan sangat berguna ketika kita harus menunjukkan suatu gambar. Berikut ini contoh penggunaan paket tikz untuk menggambarkan model atom Bohr pada mata pelajaran Kimia.
Demikian semoga bermanfaat!
Adjie Gumarang Pujakelana 2014
\documentclass{article}
\usepackage[margin=2cm]{geometry}
\title{Model Atom Bohr}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\definecolor{myyellow}{RGB}{254,241,24}
\definecolor{myorange}{RGB}{234,125,1}
\begin{document}
\pagenumbering{gobble}
\par\centering
\large\textbf{Contoh 1}\\
\medskip
\begin{tikzpicture}
\def\proton(#1,#2){%
\fill[shade=ball,ball color=myyellow] (#1,#2) circle (10pt);
\node at (#1,#2) {\texttt{+}};
}
\def\neutron(#1,#2){%
\fill[shade=ball,ball color=myorange] (#1,#2) circle (10pt);
}
\def\electron{%
\fill[shade=ball,ball color=gray!30] (0,0) circle (5pt);
\node at (0,0) {\texttt{-}};
}
\neutron(0.8,0.2)
\proton(0.5,-0.5)
\neutron(-0.25,-0.5)
\neutron(0.55,0.8)
\proton(-0.5,0.2)
\proton(-0.1,0.8)
\proton(0.5,0)
\proton(0.12,0.6)
\proton(0.12,-0.6)
\neutron(-0.25,0)
\draw[
postaction=decorate,
decoration={markings,
mark=at position 0.5 with {\electron},
mark=at position 1 with {\electron}
}]
(0,0) circle (2cm);
\draw[
postaction=decorate,
decoration={markings,
mark=at position 0.3 with {\electron},
mark=at position 0.55 with {\electron},
mark=at position 0.85 with {\electron},
mark=at position 0.75 with {\electron}
}]
(0,0) circle (3cm);
\end{tikzpicture}
\bigskip
%--------------------------------------------------------------------
\par\centering
\large\textbf{Contoh 2}\\
\begin{tikzpicture}
\def\proton(#1,#2){%
\fill[shade=ball,ball color=myyellow] (#1,#2) circle (10pt);
\node at (#1,#2) {\texttt{+}};
}
\def\neutron(#1,#2){%
\fill[shade=ball,ball color=myorange] (#1,#2) circle (10pt);
}
\def\electron{%
\fill[shade=ball,ball color=gray!30] (0,0) circle (5pt);
\node at (0,0) {\texttt{-}};
}
\def\sorbit(#1,#2){%
\draw[
color=violet,
rotate=#1,
postaction=decorate,
decoration={markings,
mark=at position #2 with {\electron},
}]
(0,0) ellipse (1.5 and 3.5);
}
\def\porbit(#1,#2){%
\draw[
color=violet,
rotate=#1,
postaction=decorate,
decoration={markings,
mark=at position #2 with {\electron},
}]
(0,0) ellipse (4 and 6);
}
%%Nucleons
\neutron(0.8,0.2)
\proton(0.5,-0.5)
\neutron(-0.25,-0.5)
\neutron(0.55,0.8)
\proton(-0.5,0.2)
\proton(-0.1,0.8)
\proton(0.5,0)
\proton(0.12,0.6)
\proton(0.12,-0.6)
\neutron(-0.25,0)
\neutron(-0.5,0.6)
\neutron(0.5,-0.3)
%%orbits
\porbit(-20,.15)
\porbit(15,.45)
\sorbit(40,.9)
\porbit(65,.6)
\sorbit(100,.3)
\porbit(125,.75)
\end{tikzpicture}
\end{document}
-->
No comments:
Post a Comment