- #1
fallingdog
- 1
- 0
The situation: I have a line represented in 3D space with XYZ coordinates. The line also has a M value for the distance from the start point in 3D. I have another data set that has "events" that I would like to find on my line. They have a distance (M) for the start and stop of the event; therefore, each event will be a line. So, I need to find all of the XYZ values for the vertexes of this new line. I plan on using python for the task.
What I am thinking is -- in pseudo code is:
So, I can find the distance between points no problem with:
d = ((x1 - x2)^2 + (y1 - y2)^2 + (z1 - z2)^2)^(1/2)
But I am not sure how to find the event points with just the M along the line. Can someone please point me to the right path?
Thanks for any help!
What I am thinking is -- in pseudo code is:
for each M value in the line starting from 0:
if the M of the event is more then the M of the vertex:
move to the next vert
else:
find the point on the line between vertexes
move to the next vert
else:
find the point on the line between vertexes
add vertexes to my new event line as needed
So, I can find the distance between points no problem with:
d = ((x1 - x2)^2 + (y1 - y2)^2 + (z1 - z2)^2)^(1/2)
But I am not sure how to find the event points with just the M along the line. Can someone please point me to the right path?
Thanks for any help!