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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply