3

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}

enter image description here

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

3

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}

enter image description here

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. – chishimotoji Jan 13 at 11:08
  • it's not supported. That's all... Maybe I'll change it or maybe not .. – Herbert 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 ... – chishimotoji 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 ? – chishimotoji Jan 14 at 0:52
  • 1
    3D angles will not be supported by pst-eucl. You have to write your own macro. Or use pst-3dplot – Herbert Jan 15 at 9:39
4
\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}

enter image description here

  • (Off topic) Where is the syntax ...(D|B){C}? I can't find it in pst-eucl. – chishimotoji Jan 12 at 15:41
  • 2
    @chishimotoji: it is a secret recipe in PSTricks. It can be used everywhere, (A|B) stands for (A.x|B.y). – God Must Be Crazy 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 ) – chishimotoji Jan 12 at 15:45
  • @chishimotoji: You must change the library. – God Must Be Crazy Jan 12 at 15:49
1

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}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.