0% found this document useful (0 votes)
154 views3 pages

Document4 PDF

This document contains a LaTeX template for an assignment using PSTricks. It includes 7 items with instructions to create various diagrams and plots using PSTricks, such as a Pythagorean triangle, Venn diagram, ellipse with foci, plots of functions, sine and cosine curves, a cardiod parametric curve. Each item contains the instruction and the PSTricks code to generate the requested figure.

Uploaded by

Rohan Rajagopal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views3 pages

Document4 PDF

This document contains a LaTeX template for an assignment using PSTricks. It includes 7 items with instructions to create various diagrams and plots using PSTricks, such as a Pythagorean triangle, Venn diagram, ellipse with foci, plots of functions, sine and cosine curves, a cardiod parametric curve. Each item contains the instruction and the PSTricks code to generate the requested figure.

Uploaded by

Rohan Rajagopal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

\documentclass{article}

\usepackage{graphicx,pstricks,authblk,amsmath,pstricks,pst-plot,pst-math}
\title{Assignment - PSTricks in \LaTeX}
\author{N.R.Rohan\\Roll No. - 1715101} %NAME AND ROLL NO. OF THE
AUTHOR
\affil{Sri Venkateswara College}
\date{August 23, 2016} %DATE TO BE SHOWN IN DOCUMENT
%PART OF THE FILE UPTO THIS LINE IS CALLED THE PREAMBLE
\begin{document}
\maketitle
\begin{enumerate}
\item
\textbf{Make a picture of a 5-12-13 Pythagorean triangle}
\begin{center}

\begin{pspicture}(5,2)
\psset{unit=0.3cm}
\psline(0,0)(0,5)(13,0)(0,0)
\put(5,-1){$12$}
\put(5,4){$13$}
\put(-0.95,1.5){$5$}
\end{pspicture}
\end{center}


.\\\\
\item{\textbf{Make a picture of the Venn diagram below}}
\begin{center}

\begin{pspicture}(8,5)
%\pscircle(2,2){1.5}
\psclip{\pscircle(2,2){3}}
\pscircle[fillcolor=gray,fillstyle=solid](6,2){3}
\endpsclip
\put(0,1.7){Multiples of $2$}
\put(3.3,1.7){Multiples}
\put(3.7,1.3){of 6}
\put(6,1.7){Multiples of $3$}
\pscircle(6,2){3}
\end{pspicture}
\end{center}

.\\\\\newpage
\item{\textbf{Make a picture of an ellipse and its foci $F_1$ and $F_2$,
illustrating the relation $F_1P + F_2P = $ constant }}\\\\\\
\begin{center}
\begin{pspicture}(4,4)
\psclip{\psellipse(2,2)(4,2.3)}
\psline(4,4)(3,2)

\psline(4,4)(1,2)
\psline[linestyle = dotted](-4,2)(8,2)
\put(3,1.5){$F_1$}
\put(1,1.5){$F_2$}
\endpsclip
\put(4.2,4.2){$P$}
\pscircle[fillstyle = solid, fillcolor = black](4,4){0.07}
%\psellipse(2,2)(1.5,1)
\end{pspicture}
\end{center}
.\\
\item
\textbf{Plot the function}
\\
\[
f(x) =
\begin{cases}
~~ x^2,~~~~~ 0\leq x \leq 2\\
-x^2, ~~-2\leq x \leq 0
\end{cases}
\]
.\\\\
\begin{pspicture}*(-5.55,-1)(5.5,5.5)
% \psgrid[gridlabels=0,gridcolor=gray,
% subgridcolor=lightgray](0,0)(5,5)
\psaxes{->}(0,0)(0,0)(5.5,5.5)
\psaxes{->}(0,0)(-5.5,-5.5)
\psplot[linecolor=red,plotstyle=line,
plotpoints=15]{0}{5}{x 2 exp}
% \rput{45}(2.5,3){\color{blue}$y=x$}
\psplot[linecolor=red,plotstyle=line,
plotpoints=15] {-5}{0}{x 2 exp } %(x^2)
\psplot[linecolor=red,plotstyle=line]
{0}{5}{x 2 exp} %(x^2)
% \rput{55}(4,2.25)
%{\color{red}$y=x^{2}$}
%\rput(0.25,5.25){$y$}
%\rput(5.25,0.25){$x$}
\end{pspicture}
\newpage

\item{\textbf{Plot y = sin x and y cos x on the same coordinate system, for
$0\leq x \leq 2\pi.$ Show the sine function as a solid curve and the cosine
functions as a dotted curve.}}


\begin{pspicture}(-5.55,-1)(5.5,5.5)

\psset{xunit=3cm,yunit=3cm}

\psaxes{->}(0,0)(0,-1.25)(2.25,1.25)
\psaxes{->}(0,0)(0,-1.25)(-2.25,1.25)
\psplot[plotpoints=2500]{-2.5}{2.5}{ x RadtoDeg sin}
\psplot[plotstyle = dots, plotpoints=25]{-2.5}{2.5}{ x RadtoDeg cos}
\put(7,-0.5){$x$}
\put(-0.5,4){$y$}
\put(4,4){$y=\sin{x}$}
\end{pspicture}

\newpage
\item{\textbf{ Plot $y = \sqrt{x}\sin{(1/x)},$ for $0 < x \leq 2$. On the same
coordinate system, plot the functions $y = \sqrt{x}$ and $y = {?}\sqrt{x}$, for $0
\leq x \leq 2$, with these functions shown as dotted curves.\\\\}}
\begin{pspicture}(-0.25,-4.25)(7.5,4.25)
\psset{xunit=3cm,yunit=3cm}
\psaxes{->}(0,0)(0,-1.25)(2.25,1.25)
\psplot[plotpoints=2500]{0.000025}{2}{x sqrt 1 x div RadtoDeg sin mul}

\psplot[linecolor=red,plotstyle=dots,plotpoints = 25]
{0}{1}{x sqrt} %(x^2)
\psplot[linecolor=red,plotstyle=dots,plotpoints = 25]
{0}{1}{x sqrt neg} %(x^2)
\put(7,-0.5){$x$}
\put(-0.5,4){$y$}
\put(4,4){$y=\sqrt{x}\sin\dfrac{1}{x}$}
\end{pspicture}

\item{\textbf{Plot the cardiod given by the parametric equation}}
\[x = \cos{t}(1-\cos{t})\]
\[y = \sin{t}(1-\cos{t})\]\\
\begin{pspicture}(-5.55,-1)(5.5,5.5)

\psset{xunit=3cm,yunit=3cm}
\psaxes[ticks=none,labels=none]{<->}(0,0)(-3,-1.5)(3,1.50)
\parametricplot[plotpoints=500,arrows=->,arrowscale=1.5]{0}{360}
{t cos t cos 2 exp sub
t sin t sin t cos mul sub}
\put(4.5,-0.5){$x$}
\put(-0.5,2.5){$y$}
\end{pspicture}
\end{enumerate}



end{document}

You might also like