Mulbah K.
asked 10/27/20Moving a point on a grid
If I had a point of a graph (x,y) and it was being pulled in several directions, but some of the directions had a stronger pull, how would I know where the point would end up. For example a point resting at (0,0) goes towards point (8,9) but only 40% of the way their, while also moving towards point (-6,-2) but only 20% and final point (-3,5) but only 15%. I could move the point in sequence but If I change the sequence it changes the final coordinate. Is their a method to do this all at once. Move the point in all directions simultaneously.
1 Expert Answer

Gavin R. answered 11/06/20
Experienced Coding Instructor and Tutor
This is a really great problem to think through, and I imagine there are several ways to complete it. A simple solution would create three vector arrays in numpy, multiply each by the percentages given, then add them all together.
You can do this in series, contrary to what you wrote. You would just have to add the distance being traveled at each step to the subsequent arrays. These are vectors, so the point we are moving toward (which is what we have) would change with each move.
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Mulbah K.
in Python if possible10/27/20