Anda di halaman 1dari 7

\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}

Assignment - PSTricks in LATEX


N.R.Rohan
Roll No. - 1715101
Sri Venkateswara College
August 23, 2016
1. Make a picture of a 5-12-13 Pythagorean triangle

13
5
12
.

2. Make a picture of the Venn diagram below

Multiples of 2

Multiples
of 6

Multiples of 3

3. Make a picture of an ellipse and its foci F1 and F2 , illustrating


the relation F1 P + F2 P = constant

F2

F1

.
4. Plot the function
{
f (x) =

0x2
2x0

x2 ,
x2 ,

.
5
4
3
2
1
5

0
0

0
0

1
1
2
3

4
5

5. Plot y = sin x and y cos x on the same coordinate system, for


0 x 2. Show the sine function as a solid curve and the cosine
functions as a dotted curve.

y
b
b

y = sin x
b
b
b

0
1

2
b


Plot y = x sin (1/x), for 0 < x 2. On the same coordinate
system, plot the functions y = x and y = ? x, for 0 x 2,
with these functions shown as dotted curves.

1
y
y = x sin
x

6.

b
b

b
b

b
b

b
b

b
b

b
b

b
b

b
b

b b

b
b

1
b

b
b

b
b

b
b

b
b

b
b

b
b

b
b

b
b

b
b

b
b

b b

7. Plot the cardiod given by the parametric equation


x = cos t(1 cos t)
y = sin t(1 cos t)

Anda mungkin juga menyukai