Graphics, Figures & TablesPlace a point on a line between two nodes

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
sourlife
Posts: 2
Joined: Mon Jul 15, 2013 1:54 pm

Place a point on a line between two nodes

Post by sourlife »

I have two points, let's say

Code: Select all

\rput(1,1){\circlenode{A}{A}}
\rput(4,8){\circlenode{B}{B}}
\ncline{A}{B}
and I want to place a dot, i.e. with \psdot, on the line between A and B at distance 1 unit from A.
So far I could only manage to get the midpoint of segment AB with \pmode, but how to get to an exact position on that line?

I don't have the coordinates of A and B to compute the point manually as I create those nodes with pst-tree commands.

Thanks for any advice

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply