I have been trying to get grep to work to find the intersection between 2 lines:
grep -Fx -f line1.txt line2.txt
Input file contents:
44.5 -125.0 44.0 -124.5 43.0 -124.3 42.0 -124.0
43.0 -128.0 43.1 -127.0 43.2 -126.0 43.3 -125.0 43.4 -124.0 43.5 -123.0 43.6 -122.0 43.7 -121.0
The problem is the 2 lines do not have a row that is exactly the same.
Does anyone have a simple way to find the intersecting point?
I was hoping to have a command find the intersection point for me. grep probably cannot do this? Also, tried GMT commands, but could not get that to work either. Any advice?
I would settle for a command that would find and write the line2.txt points that are the closest to the intersection: