[pstricks] PSTricks Digest, Vol 164, Issue 3
Germain Boyer
germain.boyer at ac-toulouse.fr
Sat Oct 29 18:34:00 CEST 2016
Thanks Herbert for your answer.
It works correctly.
I do a modification to use the possibility of arrows.
%---------------------------------------------------------------------------------------------------------------------------------------------
\makeatletter
\def\psdotsx{\@ifnextchar[{\psdotsx at i}{\psdotsx at i[]}}
\def\psdotsx at i[#1](#2){%
\def\psdotsx at para{#1}
\begingroup%
\psset{#1}\psdotsx at ii(#2)%
}% end of \def\psdotsx at i
\def\psdotsx at ii(#1){%
\pnode(#1){thenode}\psdotsx at iii%
\@ifnextchar({\psdotsx at ii}{\endgroup}
}% end of \def\psdotsx at ii
\def\psdotsx at iii{%
\pnode([nodesep=1.5mm,angle=45,\psdotsx at para]thenode){thenodea}%
\multido{\ia=0+90 , \ib=1+1}{4}{%
\psRelNode[unit=1cm,angle=\ia](thenode)(thenodea){1}{thenode\ib}
}% end of \multido
\psline(thenode3)(thenode1)%
\psline(thenode4)(thenode2)%
}% end of \def\psdotsx at iii
\makeatother
%---------------------------------------------------------------------------------------------------------------------------------------------
% examples :
%
% \SpecialCoor
% \psdotsx[nodesep=2mm,angle=45](P)
% \psdotsx[nodesep=2mm](1,3)
% \psdotsx[angle=30](2;45)
%---------------------------------------------------------------------------------------------------------------------------------------------
With the same idea i write (with your great help) the macro \psdotsl
%---------------------------------------------------------------------------------------------------------------------------------------------
\makeatletter
\def\psdotsl{\@ifnextchar[{\psdotsl at i}{\psdotsl at i[]}}
\def\psdotsl at i[#1](#2){\def\psdotsl at para{#1}
\begingroup%
\psset{#1}\psdotsl at ii(#2)}
\def\psdotsl at ii(#1){%
\pnode(#1){thenode}\psdotsl at iii%
\@ifnextchar({\psdotsl at ii}{\endgroup}
}% fin de \newcommand
\def\psdotsl at iii{%
\pnode([nodesep=1.5mm,angle=90,\psdotsl at para]thenode){thenodea}%
\multido{\ia=0+180 , \ib=1+1}{2}{%
\psRelNode[unit=1cm,angle=\ia](thenode)(thenodea){1}{thenode\ib}
}% fin du \multido
\psline(thenode2)(thenode1)%
}% fin de \newcommand
\makeatother
%---------------------------------------------------------------------------------------------------------------------------------------------
This is my pspicture with the new macros
\def\xmin{-9.6} \def\xmax{150.6} \def\ymin{-9.6} \def\ymax{200.6}
\psset{xunit=0.1cm,yunit=0.05cm,arrowinset=0,arrowlength=1.75}
\begin{pspicture}(-9.6,-9.6)(150.6,200.6)
\psset{xunit=1cm,yunit=0.5cm}
\psset{gridlabels=0pt , gridwidth=0.4pt , gridcolor=gray , subgriddiv=1}
\psgrid(0,0)(0,0)(15,20)
\psset{xunit=0.1cm,yunit=0.05cm}
%
\psaxes[linewidth=1pt,tickwidth=0.75pt,Dx=10,Dy=10]{->}(0,0)(0,0)(150,200)
\psaxes[linewidth=1pt,ticks=none,labels=none](0,0)(-0.75pt,-0.75pt)(0,0)
%
\uput[-90](150.6,0){$v_i$}
\uput[180](0,200.6){$d_i$}
%
%
\psdotsx[angle=0,linewidth=0.75pt](20,3.5)(43,20.5)(62,35.9)(80,67.8)(98,101.2)(115,135.8)(130,168.5)
%
\psdotsx[arrows=->,nodesep=10mm,angle=45,linewidth=1pt,linecolor=green](20,30)
\psdotsx[arrows=<->,nodesep=5mm,angle=0,linewidth=1pt,linecolor=red](20,50)
\psdotsx[arrows=<-,nodesep=10mm,angle=45,linewidth=1pt,linecolor=green](20,70)
%
\psdotsl[arrows=->,nodesep=10mm,angle=30,linewidth=1pt,linecolor=green](40,30)
\psdotsl[arrows=<->,nodesep=5mm,angle=0,linewidth=1pt,linecolor=red](40,50)
\psdotsl[arrows=<-,nodesep=10mm,angle=60,linewidth=1pt,linecolor=green](40,70)
%
\psplot[algebraic=true,linewidth=0.5pt]{0}{140}{(257/30000)*x^2+(43/200)*x-(317/75)}
%
%
\end{pspicture}
Now i can use \psdotsx and \psdotsl with the coordonates of the picture.
Thanks.
Is it possible to add \psdotsx and \psdotsl to pstricks-add ? So other
people can use them.
Germain
More information about the PSTricks
mailing list