\documentclass{article}
\title{Software Review: PSTricks}
\author{Agamyrat Altiyev}
\date{March 5, 2014}
\usepackage{pstricks}
\usepackage{pst-node}
\setlength{\topmargin}{-1.74cm}
\setlength{\headheight}{1cm}
\setlength{\headsep}{0.74cm}
\setlength{\textheight}{24.62cm}
\setlength{\textwidth}{15.5cm}
\setlength{\oddsidemargin}{0.46cm}
\setlength{\evensidemargin}{0.46cm}
\begin{document}
\maketitle

\section{Why PSTricks?}
PSTricks, written by Timothy Van Zandt, is a tool to draw any kinds of images including simple lines to complex graphs that is used in daily life in different fields. PSTricks uses PostScript's image creation language within LaTeX code and built-in commands make it easier to use. 

\subsection{Example} 
\textbackslash begin{pspicture}[showgrid](4,3)\\
\textbackslash psframe[linecolor=red](10,2)(13,3)\\
\textbackslash rput[color=red](11.5,2.5){Hello World}\\
\textbackslash end{pspicture}\\\\

\begin{pspicture}[showgrid](5,3)
\psframe[linecolor=red](1,1)(4,2)
\rput[color=red](2.5,1.5){Hello World}
\end{pspicture}

\vspace{.5 cm}
[showgrid] option makes it easier to apply the image since you can see see at which coordinate you would like to locate your image.

\subsection{Coordinate System}
\vspace{.5 cm}

\psset{gridcolor=orange,subgridcolor=green}
\begin{pspicture}(4,5)
\psgrid
\psframe[linecolor=red](0.7,2)(3.3,3)
\psframe[linecolor=white,fillcolor=yellow,fillstyle=solid](0.7,2)(3.3,3)
\rput(2,2.5){Hello World}
\end{pspicture}
\vspace{1.5 cm}
[showgrid] is part of $PostScript$ which makes it visible but \textbackslash psgrid is a drawn image on [showgrid].

\subsection{Line and Arrows}\vspace{.3 cm}
\textbackslash begin{{\textbraceleft}{pspicture}{\textbraceright}}[showgrid](6,6)\\
\textbackslash psline {{\textbraceleft}${-*}${\textbraceright}} (1,6)(2,6)\\
\/
\textbackslash psline {{\textbraceleft}${-}${\textbraceright}}(3,6)(4,6)\\
\textbackslash psline {{\textbraceleft}${->}${\textbraceright}}(2.5,5)(2.5,3)\\
\textbackslash pscurve {{\textbraceleft}${|-|}${\textbraceright}}(1,2)(2.5,1)(4,2)\\
\textbackslash end{{\textbraceleft}{pspicture}{\textbraceright}}\\\\
\begin{pspicture}[showgrid](6,6)
\psline{-*}(1,6)(2,6)
\psline{-}(3,6)(4,6)
\psline{->}(2.5,5)(2.5,3)
\pscurve{|-|}(1,2)(2.5,1)(4,2)
\end{pspicture}\\\\


As you can see on how given codes are related to the image above.\\ {{\textbraceleft}${-*}${\textbraceright}} is for a line with ending point bolded. \\
{{\textbraceleft}${-}${\textbraceright}} is for a straight line. \\
{{\textbraceleft}${->}${\textbraceright}} is for line with one side continuous.\\
{{\textbraceleft}${|-|}${\textbraceright}} is for a line with two sides as {{\textbraceleft}${|}${\textbraceright}} shape.


\section{Homework Exercises from the book}
\subsection{Pythagorean Triangle}
\textbackslash begin{{\textbraceleft}{pspicture}{\textbraceright}}[showgrid](12,5)\\
\textbackslash psline(1,1)(12,1)(12,5)(1,1) $------------->$ Triangle\\
\textbackslash psline(11.5,1)(11.5,1.5)(12,1.5)(12,1)$--------->$ 90 degree angle \\
\textbackslash put(7,.5){{\textbraceleft}${12}${\textbraceright}}\\
\textbackslash put(12.3,2.5{{\textbraceleft}${5}${\textbraceright}}\\
\textbackslash put(7,3.5){{\textbraceleft}${13}${\textbraceright}}\\
\textbackslash end{{\textbraceleft}{pspicture}{\textbraceright}}\\\\
\begin{pspicture}[showgrid](12,5)
\psline(1,1)(12,1)(12,5)(1,1)
\psline(11.5,1)(11.5,1.5)(12,1.5)(12,1) 
\put(7,.5){12}
\put(12.3,2.5){$5$}
\put(7,3.5){13}
\end{pspicture}\\\\



\subsection{Venn Diagram}
\textbackslash begin{{\textbraceleft}{pspicture}{\textbraceright}}(6,5)\\
\textbackslash pscircle(2,2.5){{\textbraceleft}${2}${\textbraceright}}\\
\textbackslash pscircle(4,2.5){{\textbraceleft}${2}${\textbraceright}}\\
\textbackslash put(.3,2.5){{\textbraceleft}{multiples}{\textbraceright}}\\
\textbackslash put(.6,2){{\textbraceleft}{of $2$}{\textbraceright}}\\
\textbackslash put(2.3,2.5){{\textbraceleft}{multiples}{\textbraceright}}\\
\textbackslash put(2.6,2){{\textbraceleft}{of $6$}{\textbraceright}}\\
\textbackslash put(4.3,2.5){{\textbraceleft}{multiples}{\textbraceright}}\\
\textbackslash put(4.6,2){{\textbraceleft}{of $3$}{\textbraceright}}\\
\textbackslash end{{\textbraceleft}{pspicture}{\textbraceright}}\\\\
\begin{pspicture}[showgrid](6,5)
\pscircle(2,2.5){2}
\pscircle(4,2.5){2}
\put(.3,2.5){multiples}
\put(.6,2){of 2}
\put(2.3,2.5){multiples}
\put(2.6,2){of 6}
\put(4.3,2.5){multiples}
\put(4.6,2){of 3}
\end{pspicture}
\\\\

\subsection{Icosahedral}
\begin{pspicture}[showgrid](-5,-5)(5,5)
\psset{radius=0.2}
%draw inner triangle of vertices and edges
\put(-.5,.5){\Circlenode{1}}
\put(.5,.5){\Circlenode{2}}
\put(0,-.5){\Circlenode{3}}
\ncline{1}{2}
\ncline{2}{3}
\ncline{3}{1}

%draw hexagon (around triangle) with vertices and edges
\put(0,2){\Circlenode{4}}
\put(1.5,1){\Circlenode{5}}
\put(1.5,-1){\Circlenode{6}}
\put(0,-2){\Circlenode{7}}
\put(-1.5,1){\Circlenode{9}}
\put(-1.5,-1){\Circlenode{8}}
\ncline{1}{4}
\ncline{1}{9}
\ncline{1}{8}
\ncline{2}{4}
\ncline{2}{5}
\ncline{2}{6}
\ncline{3}{6}
\ncline{3}{7}
\ncline{3}{8}
\ncline{4}{5}
\ncline{5}{6}
\ncline{6}{7}
\ncline{8}{7}
\ncline{9}{8}
\ncline{9}{4}
%draw outer triangle
\put(-5,-3.5){\Circlenode{12}}
\put(5,-3.5){\Circlenode{11}}
\put(0,5){\Circlenode{10}}
\ncline{10}{4}
\ncline{11}{10}
\ncline{12}{10}
\ncline{9}{10}
\ncline{5}{10}
\ncline{5}{11}
\ncline{11}{6}
\ncline{11}{7}
\ncline{11}{12}
\ncline{12}{7}
\ncline{12}{8}
\ncline{9}{12}
\end{pspicture}
\\\\
'\textbackslash Circlenode' is easy way to draw lines between any points on a grid. \\1. Size your 'dot' by using '\textbackslash psset{{\textbraceleft}{radius=0.2}{\textbraceright}' by changing radius.\\
2. Use '\textbackslash put' and plot any point on the grid. \\
3. Use'\textbackslash ncline' and connect two points with a line.

\subsection{Pentagon}
\begin{pspicture}[showgrid](-3,-3)(3,3)
\psset{radius=0.15}
\put(-2,2){\Circlenode{1}}
\put(2,2){\Circlenode{2}}
\put(-2,-1){\Circlenode{3}}
\put(2,-1){\Circlenode{4}}
\put(0,-3){\Circlenode{5}}
\ncline{1}{2}
\ncline{1}{3}
\ncline{1}{4}
\ncline{1}{5}
\ncline{2}{3}
\ncline{4}{2}
\ncline{5}{2}
\ncline{3}{4}
\ncline{5}{3}
\ncline{5}{4}

\end{pspicture}
\\\\\\
\LARGE \center THANK YOU!



\end{document}