TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used \psbezier to draw a triangle with pushed-in edges:

    \psdot(0,0) \uput[180](0,0){$a$}
    \psdot(3,1) \uput[45](3,1){$c$}
    \psdot(3,-1) \uput[-45](3,-1){$b$}


Now, I can't find a smart way (not using trial-and-error guessing coordinates) to connect the (unnamed) bullets on the bezier curves specified through ArrowInside and ArrowInsidePos through a straight line.

Alternatively, it would be sufficient for me to connect the intersections of a straight line with those two bezier curves. But again: I can't think of a smart way doing this using PStricks even after browsing through the comprehensive User's Guide by Timothy Van Zandt.

Any suggestions how to solve that problem?

share|improve this question
up vote 6 down vote accepted

A Bézier curve is specified as a polynomial of third order in its x and y coordinates. Here is how you can use \psparnode (from pst-node) to place nodes at any distance on the curve:

I used the formulas from the PostScript redbook, p. 565 (http://www.adobe.com/products/postscript/pdfs/PLRM.pdf‎:

\documentclass[margin=12pt, pstricks]{standalone}
      \pst@tempa /y0 ED /x0 ED
      \pst@tempb /y1 ED /x1 ED
      \pst@tempc /y2 ED /x2 ED
      \pst@tempd /y3 ED /x3 ED
      /cx { x1 x0 sub 3 mul } def
      /bx { x2 x1 sub 3 mul cx sub } def
      /ax { x3 x0 sub bx sub cx sub } def
      /cy { y1 y0 sub 3 mul } def
      /by { y2 y1 sub 3 mul cy sub } def
      /ay { y3 y0 sub by sub cy sub } def
      ax t mul bx add t mul cx add t mul x0 add
      ay t mul by add t mul cy add t mul y0 add \tx@UserCoor}{#6}%      
    \psdot(0,0) \uput[180](0,0){$a$}
    \psdot(3,1) \uput[45](3,1){$c$}
    \psdot(3,-1) \uput[-45](3,-1){$b$}

The result is:

enter image description here

Note, that the positions of \psbeziernode and ArrowInsidePos do not fully coincide for the same values.

The ArrowInside arrows are shifted a bit, which can be seen, when comparing the original nodes to ArrowInsidePos=0 and ArrowInsidePos=1.

share|improve this answer

A TikZ-based version:


\begin{tikzpicture}[marker/.style={circle,fill,draw,inner sep=1pt,pos=#1}]
\foreach \place/\angle/\name in {{(0,0)}/180/a,{(3,1)}/45/c,{(3,-1)}/-45/b}
\filldraw[black] \place circle (1.5pt) 
node[label={\angle:$\name$},inner sep=0pt](\name){};
\draw (a) edge[bend left=15] 
  node[marker=0.75](a-b){}% marking the path a-b: select the position [0,1]
  (b) ;
\draw (c) edge[bend right=15] 
  node[marker=0.7](c-b){}% marking the path c-b: select the position [0,1]
  (b) ;
\draw (c) edge[bend left=15](a);

\draw[red](a-b)--(c-b); % interconnecting the two markers

The result:

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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