3

The circle is divided into 8 equal parts and a horizontal and vertical arrow has to be put at the midpoint of each division.

On the right half, the horizontal arrows are directed to right side. On the left half, the horizontal arrows are directed to left side.

On the bottom half, the vertical arrows are directed downwards. On the top half, the horizontal arrows are directed upwards.

I'm able to put an arrow in radial direction. I have trouble placing horizontal and vertical direction arrows.

enter image description here

CODE

\begin{pspicture}(-5,-5)(5,5)
    \pscircle(0,0){4.0}
    \multido{\ix=0+45}{8}
    {
      \rput{\ix}(0,0){\psline(3.9,0)(4.05,0)}
    } 
    \rput{22.5}(0,0){\psline{->}(3.4,0)(4.0,0)}
  \end{pspicture}
0

3 Answers 3

5

If I've understood well what you want, here is a short code:

\documentclass[a4paper,11pt,x11names,svgnames]{article}
\usepackage[margin =1.5cm]{geometry}
\usepackage{pstricks-add}
\usepackage{auto-pst-pdf}
\usepackage{xcolor}

\def\rvect{\psline[linecolor=LightPink1]{->}(0,0)(0.5,0)}
\def\lvect{\psline[linecolor=HotPink3]{->}(0,0)(-0.5,0)}
\def\uvect{\psline[linecolor=SlateGray1]{->}(0,0)(0,0.5)}
\def\dvect{\psline[linecolor=SkyBlue4]{->}(0,0)(0,-0.5)}

\begin{document}%

\begin{pspicture}(-5,-5)(5,5)
\pscircle[linecolor =DarkSeaGreen3](0,0){4.0}
\multido{\i = 0 + 45}{8}{\psset{origin = {4 ; \i}}\psline[linecolor =DarkSeaGreen3](-0.1 ; \i)(0.1 ; \i)}
\psset{dotsize = 1pt, linewidth = 1.2pt}
\multido{\n = -67.5 + 45.0}{4}{\rput(4;\n){\rvect}\rput(-4;\n){\lvect}}%
\multido{\n = 22.5 + 45.0}{4}{\rput(4;\n){\uvect}\rput(-4;\n){\dvect}\psdot(4;\n)\psdot(-4;\n)}%
\end{pspicture}

\end{document}

enter image description here

1

enter image description here

THE CODE

\documentclass[a4paper,11pt,x11names,svgnames]{article}
\usepackage[margin =1.5cm]{geometry}
\usepackage{pstricks-add}
\usepackage{auto-pst-pdf}
\usepackage{xcolor}
\usepackage{amsmath}

\def\rvect{\psline{->}(-0.5,0)(0,0)}
\def\lvect{\psline{->}(0.5,0)(0,0)}
\def\uvect{\psline{->}(0,-0.5)(0,0)}
\def\dvect{\psline{->}(0,0.5)(0,0)}

\begin{document}%

\begin{pspicture}(-5,-5)(5,5)
\pscircle(0,0){4.0}
\multido{\i = 0 + 45}{8}{
         \psset{origin = {4 ; \i}}\psline(-0.1 ; \i)(0.1 ; \i)
        }
\multido{\n = -67.5 + 45.0}{4}{
         \rput(4.0;\n){\rvect}
         \rput(-4.0;\n){\lvect}
        }%
\multido{\n = 22.5 + 45.0}{4}{
         \rput(4;\n){\uvect}
         \rput(-4;\n){\dvect}
        }%
\end{pspicture}

\end{document} 

Thanks a tonne Bernard. It is your code, I modified a bit to get the required geometry!

2
  • 1
    Welcome to TeX.SX! It's not usual to grab code from other answers to the same question in order to provide an answer
    – user31729
    Sep 20, 2014 at 5:31
  • You can instead propose an edit to his answer by clicking the edit button under his answer.
    – percusse
    Sep 20, 2014 at 10:10
0

Saving more keystrokes with PSTricks, just for fun.

\documentclass[pstricks,border=12pt,dvipsnames]{standalone}
\usepackage{multido}

\psset{linecolor=ForestGreen}
\begin{document}
\begin{pspicture}[dimen=m](-4,-4)(4,4)

    \pscircle{3}
    \multido{\i=0+45,\n=22.5+45.0}{8}
    {
        \psline(2.9;\i)(3.1;\i)
        \rput(3;\n){%
            \psline[linecolor=Magenta]{->}(!\n\space cos 0 lt {-.6}{.6} ifelse 0)%
            \psline[linecolor=NavyBlue]{->}(!0 \n\space sin 0 lt {-.6}{.6} ifelse)%
        }
    }
\end{pspicture}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .