Calculate Points Along a Vector Given A Step Interval

198 Views Asked by At

Imagine I have starting point at A and a destination at B

enter image description here

I have this setup as a vector so I know its length and direction etc.

What I would like to do is draw dots along this vector

enter image description here

But I would like to control the spacing between those dots which I call the step interval

Could anyone point me to what I would need to learn or lookup to solve the above issue

Thanks

1

There are 1 best solutions below

2
On

Define

$$ {\bf v}(t) = {\bf A} + t ({\bf B} - {\bf A}) $$

for $t \in [0, 1]$. If you want a sequence of points just give $t$ equally spaced values. For example, if you want $N+1$ equally separated points you can create the sequence

$$ {\bf v}_i= {\bf v}(i/N) = {\bf A} + \frac{i}{N} ({\bf B} - {\bf A}) ~~~\mbox{for}~~~ i=0,1,\cdots,N $$