# How to fill a right-angle mark with a color?

I fails to fill the right-angle mark with green color as follows.

\documentclass[12pt]{standalone}
\usepackage{pst-eucl,pst-calculate}
\begin{document}
\begin{pspicture}(-.6,-1)(4.85,4)
\def\b{3}
\pstGeonode[PosAngle={-135,135,-45}](0,0){A}(0,\b){B}(\pscalculate{\b*sqrt(2)},0){D}
\pstTranslation[PosAngle=45]{A}{D}{B}[C]
\pstMiddleAB{B}{C}{M}
\pstInterLL[PointName=none]{A}{C}{M}{D}{E}
\pstRightAngle[RightAngleSize=.2,fillstyle=solid,fillcolor=green]{M}{E}{C}
\psline(A)(B)(C)(D)(A)(C)(M)(D)
\end{pspicture}
\end{document}


How to fill a right-angle mark with a color?

If node A is not the origin, then use the coordinate pair {AD,CD} which is {(4,3)} instead of {(C)} for the rotation of \rput

\documentclass[12pt]{standalone}

\usepackage{pst-eucl,pst-calculate}
\begin{document}
\begin{pspicture}(-.6,-1)(4.85,4)
\def\b{3}
\pstGeonode[PosAngle={-135,135,-45}](0,0){A}(0,\b){B}(\pscalculate{\b*sqrt(2)},0){D}
\pstTranslation[PosAngle=45]{A}{D}{B}[C]
\pstMiddleAB{B}{C}{M}
\pstInterLL[PointName=none]{A}{C}{M}{D}{E}
\rput{(C)}(E){\psframe[fillcolor=red,fillstyle=solid](0.2,0.2)}%%%%%
\psline(A)(B)(C)(D)(A)(C)(M)(D)
\end{pspicture}
\end{document}


With pst-eucl.tex from http://archiv.dante.de/~herbert/TeXnik/tex/generic/pst-eucl/ you can use:

\pstRightAngle[RightAngleSize=.2,fillstyle=solid,fillcolor=green]{M}{E}{C}

• Please tell me know why the command \pstRightAngle[RightAngleSize=.2,fillstyle=solid,fillcolor=green]{M}{E}{C} does not get the same result as \rput{(C)}(E){\psframe[fillcolor=red,fillstyle=solid](0.2,0.2)} by default. – Trong Vuong Jan 13 at 11:08
• it's not supported. That's all... Maybe I'll change it or maybe not .. – user2478 Jan 13 at 11:12
• " added fillstyle for angles " from up-to-date of pst-eucl.tex .... But the command \pstMarkAngle[fillstyle=solid,fillcolor=red!50]{B}{C}{A}{$\theta$} does not work ... – Trong Vuong Jan 14 at 0:42
• And I replaced it by the command \psGetAngleABC[WedgeOpacity=1.2,WedgeColor=yellow,LabelSep=0.5](B)(C)(A){$\beta$}. How do you think ? – Trong Vuong Jan 14 at 0:52
• 3D angles will not be supported by pst-eucl. You have to write your own macro. Or use pst-3dplot – user2478 Jan 15 at 9:39
\documentclass[pstricks,12pt]{standalone}
\usepackage{pst-eucl}
\def\b{3 }
\begin{document}
\begin{pspicture}(-.6,-1)(4.85,4)
\pstGeonode[PosAngle={-135,135,-45,45}](0,0){A}(!0 \b){B}(!\b 2 sqrt mul 0){D}(D|B){C}
\pstMiddleAB{B}{C}{M}
\pstInterLL[PointName=none]{A}{C}{M}{D}{E}
\pspolygon[fillstyle=solid,fillcolor=green](E)([nodesep=6pt]{C}E)([offset=6pt,nodesep=6pt]{C}E)([offset=6pt]{C}E)
\psline(A)(B)(C)(D)(A)(C)(M)(D)
\end{pspicture}
\end{document}


• (Off topic) Where is the syntax ...(D|B){C}? I can't find it in pst-eucl. – Trong Vuong Jan 12 at 15:41
• @chishimotoji: it is a secret recipe in PSTricks. It can be used everywhere, (A|B) stands for (A.x|B.y). – Gold Digging Programmer Jan 12 at 15:42
• No, I want \pstRightAngle[RightAngleSize=.2,fillstyle=solid,fillcolor=green]{M}{E}{C} to get a result like your syntax.( default ) – Trong Vuong Jan 12 at 15:45
• @chishimotoji: You must change the library. – Gold Digging Programmer Jan 12 at 15:49

Herbert's solution can be generalized by replacing his

\rput{(C)}(E){\psframe[fillcolor=red,fillstyle=solid](0.2,0.2)}%%%%%


with

\pnode(C){c}% temporary
\pnode(E){e}% temporary
\rput{!N-c.y N-e.y sub N-c.x N-e.x sub atan}(E){\psframe[fillcolor=red,fillstyle=solid](0.2,0.2)}%%%%%


Red alert: the temporary nodes are important and needed because it is one of PSTricks' hidden features. We cannot substitute !N-C.y N-E.y sub N-C.x N-E.x sub atan for !N-c.y N-e.y sub N-c.x N-e.x sub atan.

The complete code is as follows. I translated all points with (1,1) vector just to see a non-trivial effect.

\documentclass[12pt]{standalone}

\usepackage{pst-eucl,pst-calculate}
\begin{document}
\begin{pspicture}[saveNodeCoors,showgrid](6,5)
\def\b{3}
\pstGeonode[PosAngle={-135,135,-45}](1,1){A}(1,\pscalculate{\b+1}){B}(\pscalculate{\b*sqrt(2)+1},1){D}
\pstTranslation[PosAngle=45]{A}{D}{B}[C]
\pstMiddleAB{B}{C}{M}
\pstInterLL[PointName=none]{A}{C}{M}{D}{E}
\pnode(C){c}% temporary
\pnode(E){e}% temporary
\rput{!N-c.y N-e.y sub N-c.x N-e.x sub atan}(E){\psframe[fillcolor=red,fillstyle=solid](0.2,0.2)}%%%%%
\psline(A)(B)(C)(D)(A)(C)(M)(D)
\end{pspicture}
\end{document}

• Hehe, thank you. :-)) – Trong Vuong Jan 14 at 0:07