Isma Hène
Isma Hène

Reputation: 49

find coordinates from a point and giving distancein plot

Let's say I'm moving from the top of the peak with a giving distance of 1 nm before the peak (at left). How can I get the index or the coordinate of the arrival point?

data looks like this:

timeInS= [0.000000e+00, 1.000000e-10, 2.000000e-10, 3.000000e-10, 4.000000e-...]
force=[-0.0030, 20.3471, 41.1066, 8.4028, 60.1618 ...]
#distance is eucleadian distance
for i in range(len(force)-1):
    distance.append ( math.sqrt( ((ts[i]-f[i])**2)+((ts[i+1]-f[i+1])**2) ))

please see plot here: force vs time

Upvotes: 0

Views: 218

Answers (1)

Saurabh Kansal
Saurabh Kansal

Reputation: 702

let us suppose, we have point A= (t1, f1) at top and point C= (t2,f2), whose coordinates you know as shown in picture. Calculate the equation of the line

y = mx+c

enter image description here

Solve for fx and tx.

Upvotes: 1

Related Questions