Monday, October 27, 2014

Teks dan Bayangannya

Seringkali dapat kita rasakan bahwa suatu teks yang disertai dengan bayangannya tampak sangat menarik ketika dilihat. 
Perhatikan teks "Sebuah harapan Baru" pada gambar di samping ini! Tampak bahwa teks tersebut disertai dengan bayangannya.

Bagaimana cara membuat bayangan teks dalam $\small\LaTeX$?

Untuk hal ini kita memerlukan paket shadowtext dari Yori Zwols. Petunjuk teknisnya dapat Anda pelajari pada dokumen yang terlampir di bawah ini.
Dokumen tersebut saya susun dalam jaringan melalui Online LaTeX Editor ShareLaTeX dengan menggunakan kelas dokumen Beamer Fancyslides dari Pawel Lupkowski.

Adapun tentang bagaimana cara membuat pembesaran objek dari bagian gambar akan dijelaskan pada tulisan lain.
Demikian semoga bermanfaat.

Adjie Gumarang Pujakelana 2014 



Saturday, October 25, 2014

Cancel

Dalam proses pengerjaan hitung Matematika sering ditemukan penyederhanaan dalam bentuk pembagian antara suatu faktor terhadap penyebut suatu pecahan dari faktor lainnya. 
Perhatikan gambar di samping! Bagaimana hal itu dapat dilakukan?

Salah satunya, kita memerlukan paket cancel dari Don­ald Arse­neau. Paket ini digunakan untuk membuat ruas garis diagonal (yaitu untuk "mencoret") dan ruas garis berpanah (yang menunjuk "ke suatu nilai") dalam proses penyederhanaan terhadap perhitungan (operasi pembagian) dalam Matematika.

Paket cancel memiliki empat macam perintah yaitu:

  • \cancel, untuk mencoret berbentuk slash
  • \bcancel, untuk mencoret berbentuk backslash
  • \xcancel, untuk mencoret berbentuk silang (yaitu penggabungan \cancel dan \bcancel sekaligus)
  • \cancelto{}{}, untuk mencoret berbentuk panah

Pewarnaan dibentuk oleh perintah baru:
\renewcommand{\CancelColor}{\color{blue}}
Berikut ini contoh-contoh hasil penggunaan dari keempat perintah tersebut.
Contoh-contoh lainnya:
Perhatikan contoh terakhir, "pencoretan" dengan ruas garis berpanah mengarah ke bawah. Ini memerlukan perintah baru dan untuk itu saya gunakan paket tikz dengan library calc sebagai berikut.
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand*\canc[1]{%
  \mathchoice
    {\scriptstyle#1}
    {\scriptstyle#1}
    {\scriptscriptstyle#1}
    {\scriptscriptstyle#1}
}
\newcommand*\Dcancelto[2][0]{%
  \kern9pt%
  \begin{tikzpicture}[baseline=(current bounding box.center).anchor=west]
    \node[anchor=east,inner sep=2pt] (a) {#2};
    \draw[->,blue] ($(a.north west)+(1pt,-2pt)$) -- ($(a.south east)+(0pt,2pt)$) node at ($(a.south east)+(4pt,1pt)$) {$\canc{#1}$};
\end{tikzpicture}
}
Nah, berikut ini pengkodean selengkapnya untuk semua contoh tersebut di atas. Dokumen ini saya susun (compile) dalam jaringan melalui Online LaTeX Editor ShareLaTeX.
Demikian semoga bermanfaat.

Adjie Gumarang Pujakelana 2014 
\documentclass{scrartcl}
\usepackage{amsmath,concmath}
\usepackage{gentium}
\usepackage{adjustbox}
\usepackage{cancel}
\usepackage[svgnames]{xcolor}
\usepackage[margin=2cm]{geometry}
%----------------------------------------
\usepackage{tikz}
\usetikzlibrary{fadings,patterns}
\usetikzlibrary{calc}
\newcommand*\canc[1]{%
  \mathchoice
    {\scriptstyle#1}
    {\scriptstyle#1}
    {\scriptscriptstyle#1}
    {\scriptscriptstyle#1}
}
\newcommand*\Dcancelto[2][0]{%
  \kern9pt%
  \begin{tikzpicture}[baseline=(current bounding box.center).anchor=west]
    \node[anchor=east,inner sep=2pt] (a) {#2};
    \draw[->,blue] ($(a.north west)+(1pt,-2pt)$) -- ($(a.south east)+(0pt,2pt)$) node at ($(a.south east)+(4pt,1pt)$) {$\canc{#1}$};
\end{tikzpicture}
}
%----------------------------------------
\renewcommand{\CancelColor}{\color{blue}} %change cancel color to blue

\begin{document}

\begin{tikzfadingfrompicture}[name=distress]
\node[text=transparent!0] {\it\Huge\textbf{Penggunaan Paket Cancel}};
\end{tikzfadingfrompicture}
\begin{tikzpicture}
\fill[preaction={fill},pattern color=CadetBlue,pattern=crosshatch dots] (-8,-1) rectangle (8,1);
\fill[pattern color=Khaki,
  pattern=crosshatch,
  path fading=distress,
  fit fading=false
] (-7,-1) rectangle (7,1);
\end{tikzpicture}

\vspace{1cm}
%http://tex.stackexchange.com/questions/107668/how-to-use-cancel-command
\abovedisplayskip=0pt

\adjustbox{valign=t}{\begin{minipage}{0.45\textwidth}
Hasil perintah {\tt\textbackslash cancel}

\[
\frac{a\cancel{b}}{\cancel{b}}=a
\]
    \end{minipage}}%
    \hfill
\adjustbox{valign=t}{\begin{minipage}{0.45\textwidth}
Hasil perintah {\tt\textbackslash bcancel}

\[
\frac{a\bcancel{b}}{\bcancel{b}}=a
\]
    \end{minipage}}%
    \hfill

\bigskip
\adjustbox{valign=t}{\begin{minipage}{0.45\textwidth}
Hasil perintah {\tt\textbackslash xcancel}

\[
\frac{a\xcancel{b}}{\xcancel{b}}=a
\]
    \end{minipage}}%
    \hfill
\adjustbox{valign=t}{\begin{minipage}{0.45\textwidth}
Hasil perintah {\tt\textbackslash cancelto}

\[
\cancel{2}\cdot\frac{9}{\cancelto{2}{4}}=\frac{9}{2}
\]
    \end{minipage}}%
    \hfill

\vspace{1cm}
\adjustbox{valign=t}{\begin{minipage}{0.3\textwidth}
\[\cancel{\text{Ini dicoret}}\]
    \end{minipage}}%
    \hfill
\adjustbox{valign=t}{\begin{minipage}{0.3\textwidth}
\[ \bcancel{\frac{4}{7}\times\frac{3}{4}} \]
    \end{minipage}}%
    \hfill
%http://tex.stackexchange.com/questions/14385/cancel-package-downward-arrow
\adjustbox{valign=t}{\begin{minipage}{0.3\textwidth}
\[ \Dcancelto[3]{18}\cdot\frac{5}{\bcancel{6}}=15 \]
    \end{minipage}}%
    \hfill
    
\vspace{1cm}
\centering
\fbox{\parbox{0.7\textwidth}{\begin{align*}
\lim_{x\to2}\frac{x^2-4}{\sqrt{5x-1}-\sqrt{3x+3}} &= \lim_{x\to2}\frac{(x-2)(x+2)}{5x-1-(3x+3)}\times \frac{2(3)}{1}\\
 &= \lim_{x\to2}\frac{(x-2)(x+2)}{5x-1-3x-3}\times \frac{6}{1}\\
 &= \lim_{x\to2}\frac{(x-2)(x+2)}{2x-4}\times 6\\
 &= \lim_{x\to2}\frac{\cancel{(x-2)}(x+2)}{2\cancel{(x-2)}}\times 6\\
 &= \lim_{x\to2}\frac{x+2}{2}\times 6\\
 &= \frac{2+2}{2}\times 6\\
 &= 12
\end{align*}}}

\end{document}



Sunday, October 5, 2014

Kurva Parametrik #3

Ini adalah tiga contoh terakhir dari kurva parametrik, setelah yang ini dan yang itu. Semuanya saya susun (compile) dalam jaringan melalui Online LaTeX Editor ShareLaTeX.
Demikian semoga bermanfaat.

Adjie Gumarang Pujakelana 2014 







Contoh 7

\documentclass[a4paper,10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{concmath,gentium}
\usepackage[svgnames]{xcolor}
\setlength{\parindent}{0pt}
\usepackage{fix-cm}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{tikz}

\begin{document}

\color{MidnightBlue}
\centering
\begin{tikzpicture}[-latex,scale=2.15]

% Draw the lines at multiples of pi/12
\foreach \ang in {0,...,31} {
  \draw [lightgray] (0,0) -- (\ang * 180 / 16:4);
}

% Concentric circles and radius labels
\foreach \s in {0, 1, 2, 3} {
  \draw [lightgray] (0,0) circle (\s + 0.5);
  \draw (0,0) circle (\s);
  \node [fill=white] at (\s, 0) [below] {\scriptsize $\s$};
}

% Add the labels at multiples of pi/4
\foreach \ang/\lab/\dir in {
  0/0/right,
  1/{\pi/4}/{above right},
  2/{\pi/2}/above,
  3/{3\pi/4}/{above left},
  4/{\pi}/left,
  5/{5\pi/4}/{below left},
  7/{7\pi/4}/{below right},
  6/{3\pi/2}/below} {
  \draw (0,0) -- (\ang * 180 / 4:4.1);
  \node [fill=white] at (\ang * 180 / 4:4.2) [\dir] {\scriptsize $\lab$};
}

% The double-lined circle around the whole diagram
\draw [style=double] (0,0) circle (4);

\fill [fill=red!50!black, opacity=0.5] plot [domain=-pi/2:pi/2] (xy polar cs:angle=\x r,radius= {2-2*sin(\x r)});
\draw [thick,color=red,domain=0:2*pi,samples=200,smooth] plot (xy polar cs:angle=\x r,radius= {2-2*sin(\x r)});
\node [fill=white] at (2,1) {$r=2-2\sin\theta$};
\end{tikzpicture} 

\end{document}





Contoh 8

\documentclass[a4paper,10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{concmath,gentium}
\usepackage[svgnames]{xcolor}
\setlength{\parindent}{0pt}
\usepackage{fix-cm}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{tikz}

\begin{document}

\color{MidnightBlue}
\centering
\begin{tikzpicture}[-latex,scale=2.15]
\fill [fill=Tomato, opacity=0.75] plot [domain=-pi/2:pi/2] (xy polar cs:angle=\x r,radius= {2-2*sin(\x r)});
\draw [thick,color=Tomato,domain=0:2*pi,samples=200,smooth] plot (xy polar cs:angle=\x r,radius= {2-2*sin(\x r)});
\node [fill=white] at (0,0.75) {\fontsize{.5cm}{1.95cm}\selectfont$r=2-2\sin\theta$};
\end{tikzpicture} 

\end{document}




Contoh 9

\documentclass[a4paper,10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{concmath,gentium}
\usepackage[svgnames]{xcolor}
\setlength{\parindent}{0pt}
\usepackage{fix-cm}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
    \usepgfplotslibrary{polar}
    \usepgfplotslibrary{units}
\pgfplotsset{every axis/.append style={
                    axis x line=middle,    % put the x axis in the middle
                    axis y line=middle,    % put the y axis in the middle
                    axis line style={<->,color=blue}, % arrows on the axis
                    xlabel={$x$},          % default put x on x-axis
                    ylabel={$y$},          % default put y on y-axis
            }}

\begin{document}

\color{MidnightBlue}
\centering
\begin{tikzpicture}[scale=2.5]
\begin{axis}[
    domain=-pi/2:pi/2, % The range over which to evaluate the functions
    xtick={-1,...,1}, ytick={-1,...,1}, % Tick marks only on integers between -1 and 1
    axis lines=middle, % Axis lines go through (0,0)
    enlargelimits=true, % Make the axis lines a bit longer than required for the plots
    samples=101, % Number of samples for evaluating the functions (use an odd number to capture the (0,0) point
    xlabel=$x$, ylabel=$y$, % Axis labels
    clip=false % So the labels aren't cut off
]
\addplot [thick, IndianRed]
    ( {sqrt(2) * sin(deg(x))},
      {abs(sin(deg(x*2)))} )
    node [pos=0.8, anchor=south] {$f(x) = |x|\sqrt{2-x^2}$}; % Add a text node at 80% of the plot length
\addplot [thick, SeaGreen]
    ( {sqrt(2) * sin(deg(x))},
      {-abs(sin(deg(x*2)))} )
    node [pos=0.8, anchor=north] {$f(x) = -|x|\sqrt{2-x^2}$};
\end{axis}
\end{tikzpicture}

\end{document}




Kurva Parametrik #2


Melanjutkan contoh-contoh sebelumnyaberikut ini saya tampilkan kembali tiga contoh kurva parametrik lainnya. Semuanya saya susun (compile) dalam jaringan melalui Online LaTeX Editor ShareLaTeX.
Demikian semoga bermanfaat.

Adjie Gumarang Pujakelana 2014 


Contoh 4

\documentclass[a4paper,10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{concmath,gentium}
\usepackage[svgnames]{xcolor}
\setlength{\parindent}{0pt}
\usepackage{fix-cm}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
    \usepgfplotslibrary{polar}
    \usepgfplotslibrary{units}
\pgfplotsset{every axis/.append style={
                    axis x line=middle,    % put the x axis in the middle
                    axis y line=middle,    % put the y axis in the middle
                    axis line style={<->,color=blue}, % arrows on the axis
                    xlabel={$x$},          % default put x on x-axis
                    ylabel={$y$},          % default put y on y-axis
            }}

\begin{document}

\color{MidnightBlue}
\centering
\begin{tikzpicture}[scale=2]
   \begin{polaraxis}[grid=none, axis lines=none]
     \addplot[mark=none,domain=0:360,samples=300] {cos(225*x)};
   \end{polaraxis}
\draw node [LemonChiffon] at (3.45,3.45) {\fontsize{.5cm}{1.95cm}\selectfont$\cos 225x$};
 \end{tikzpicture}

\end{document}




Contoh 5

\documentclass[a4paper,10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{concmath,gentium}
\usepackage[svgnames]{xcolor}
\setlength{\parindent}{0pt}
\usepackage{fix-cm}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
    \usepgfplotslibrary{polar}
    \usepgfplotslibrary{units}
\pgfplotsset{every axis/.append style={
                    axis x line=middle,    % put the x axis in the middle
                    axis y line=middle,    % put the y axis in the middle
                    axis line style={<->,color=blue}, % arrows on the axis
                    xlabel={$x$},          % default put x on x-axis
                    ylabel={$y$},          % default put y on y-axis
            }}

\begin{document}

\color{MidnightBlue}
\centering
\begin{tikzpicture}[scale=2.25]
\begin{polaraxis}[
axis lines*=none,
ytick=\empty,xlabel=\empty,
axis line style = {draw=white,line width=0.0001pt},
hide y axis,
xticklabel={
\pgfmathparse{\tick/180}
\pgfmathifisint{\pgfmathresult}{$\pgfmathprintnumber[int detect]{\pgfmathresult}\pi$}%
{$\pgfmathprintnumber[frac,frac denom=6,frac whole=false]{\pgfmathresult}\pi$}
}
]
\addplot[IndianRed,thick,mark = none, domain = 0.4:12, samples = 600, data cs = polarrad]{sin(x)};
\end{polaraxis}
\end{tikzpicture}

\end{document}




Contoh 6

\documentclass[a4paper,10pt]{standalone}

\usepackage[T1]{fontenc}
\usepackage{concmath,gentium}
\usepackage[svgnames]{xcolor}
\setlength{\parindent}{0pt}
\usepackage{fix-cm}
\usepackage{graphicx}
\usepackage{amsmath}

\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
    \usepgfplotslibrary{polar}
    \usepgfplotslibrary{units}
\pgfplotsset{every axis/.append style={
                    axis x line=middle,    % put the x axis in the middle
                    axis y line=middle,    % put the y axis in the middle
                    axis line style={<->,color=blue}, % arrows on the axis
                    xlabel={$x$},          % default put x on x-axis
                    ylabel={$y$},          % default put y on y-axis
            }}

\begin{document}

\color{MidnightBlue}
\centering
\begin{tikzpicture}[scale=2.25]
\begin{polaraxis}[enlargelimits=false,
axis lines*=none,xlabel=\empty,
hide y axis,
xticklabel=$\pgfmathprintnumber{\tick}^\circ$]
\addplot[IndianRed,thick,samples=100,
domain=0:360]{0.5 + 0.5*cos(x)};
        %Supercardioid
\end{polaraxis}
\end{tikzpicture}

\end{document}




Kurva Parametrik #1

Dalam matematika, persamaan parametrik dari suatu kurva menyatakan koordinat titik-titik pada kurva itu sebagai fungsi dari suatu variabel, yang disebut parameter. Sebagai contoh, 
\begin{align}
x &= \cos t \\
y &= \sin t
\end{align}
adalah persamaan parametrik untuk lingkaran satuan, di mana $t$ adalah parameter. Secara bersama-sama, kedua persamaan itu disebut representasi parametrik dari kurva tersebut. (wikipedia)

Nah, berikut ini saya tampilkan tiga contoh kurva parametrik. Semuanya saya susun (compile) dalam jaringan melalui Online LaTeX Editor ShareLaTeX.
Demikian semoga bermanfaat.

Adjie Gumarang Pujakelana 2014 




Contoh 1

\documentclass[a4paper,10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{concmath,gentium}
\usepackage[svgnames]{xcolor}
\setlength{\parindent}{0pt}
\usepackage{fix-cm}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.text}
\usetikzlibrary{arrows,intersections,decorations.markings}
\tikzset{
    arrow inside/.style = {
        postaction = {
            decorate,
            decoration={
                markings,
                mark=at position 0.5 with {\arrow{>}}
            }
        }
    }
}

\begin{document}

\color{MidnightBlue}
\centering
\begin{tikzpicture}[scale=1.25]
    
\fill [draw=MidnightBlue,fill=none,very thick,
         postaction={decorate,
                     decoration={raise=4pt,
                                 text along path,text color=DarkSlateGray,
text={}
                                }}]
                     plot[thick,domain=-8:8,samples=500]({7*cos(\x r)^3},{7*sin(\x r)^3});
\draw node [Maroon] at (0,0) {\fontsize{.75cm}{1.95cm}\selectfont$\left(7\cos x^3,\ 7\sin x^3\right)$};
\end{tikzpicture}

\end{document}



Contoh 2

\documentclass[a4paper,10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{concmath,gentium}
\usepackage[svgnames]{xcolor}
\setlength{\parindent}{0pt}
\usepackage{fix-cm}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.text}
\usetikzlibrary{arrows,intersections,decorations.markings}
\tikzset{
    arrow inside/.style = {
        postaction = {
            decorate,
            decoration={
                markings,
                mark=at position 0.5 with {\arrow{>}}
            }
        }
    }
}

\begin{document}

\color{MidnightBlue}
\centering
\begin{tikzpicture}[scale=1]
    
\fill [draw=MidnightBlue,fill=none,very thick,
         postaction={decorate,
                     decoration={raise=4pt,
                                 text along path,text color=DarkSlateGray,
text={}
                                }}]
                     plot[domain=-2.5:2.5,samples=500]({(\x)^3-3*\x},{3*(\x)^2-16});
\draw node [Maroon] at (0,-1) {\fontsize{.75cm}{1.95cm}\selectfont$\left(x^3-3x,\ 3x^2-16\right)$};
\end{tikzpicture}

\end{document}



Contoh 3

\documentclass[a4paper,10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{concmath,gentium}
\usepackage[svgnames]{xcolor}
\setlength{\parindent}{0pt}
\usepackage{fix-cm}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{xpicture}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
    \usepgfplotslibrary{polar}
    \usepgfplotslibrary{units}
\pgfplotsset{every axis/.append style={
                    axis x line=middle,    % put the x axis in the middle
                    axis y line=middle,    % put the y axis in the middle
                    axis line style={<->,color=blue}, % arrows on the axis
                    xlabel={$x$},          % default put x on x-axis
                    ylabel={$y$},          % default put y on y-axis
            }}

\begin{document}

\color{MidnightBlue}
\centering
\begin{tikzpicture}[scale=2.25]
        \begin{polaraxis}
[axis lines*=none,ytick=\empty,xlabel=\empty,ylabel=\empty,hide y axis,
axis line style = {draw=White,line width=0.0001pt},]
            \def\FREQUENCY{3}
            \addplot[IndianRed,domain=0:360,samples=360,smooth,thick] (x,{30-25*sin(\FREQUENCY*x)});
            \addplot[dashed,domain=0:2*pi,samples=360] (deg(x),30);
\addplot[mark=*,only marks] coordinates {(0,0)};
        \end{polaraxis}
    \end{tikzpicture}

\end{document}



Related Posts Plugin for WordPress, Blogger...