How to place marker on one line and get coordinates
<p>1)I want to place a marker on one line,(between two points) in function of the lenght of the line.</p>

<p>2)I want to know the coordinates of this point/marker.</p>

<pre><code>import matplotlib.pyplot as plt
import math
x1 = 0
x2 = 9
y1 = 5
y2 = 7
plt.plot((x1, x2), (y1, y2))
lenghtline1 = math.sqrt((x1-x2)**2 + (y1-y2)**2)
</code></pre>

<p>Here the distance between the two points is 9.2 , </p>

<p>How can i put a marker in the line(between the two points) to 6 from point1?</p>

<p>How can i know the coordinates (x,y) of this marker?
thank you</p>

<p>Point with distance <code>len</code> to the first point will have coordinates</p>

<pre><code>  x = x1 + (x2-x1) * len / lenghtline1
  y = y1 + (y2-y1) * len / lenghtline1
</code></pre>

python python-3.x numpy math matplotlib