I’ve able to have a shape follow a circular path and now I’d like to do the same thing with other paths starting with a straight line. I once had some BASIC code that plotted a line but that was 40 odd years ago and I cannot find the formula on the Internet. Of course plotting a line where the beginning x or Y is the same as the end x or y is straight forward but what about a line that slopes?
Perhaps there’s a library that would allow me to divide a line into points between the beginning and end points?
Since posting this I’ve found some information but it’s now working. This is what I’ve tried:
Plus other similar variations. The best that I can achieve is px and py at the end of the line rather at some point along the line. More thought required.
I am not sure if the following code is what you need, but I recently created my own plotter class
Maybe there are parts that are useful to you
The points are generated randomly and added to the plot.