Reputation: 1190
This might be a stupid question...
I've two vectors containing Y coords X is simply 1:8
I've added the lines to a plot area and would like to identify the point of intersection of the two lines.
Is there a default package to find this?
Thanks
Upvotes: 0
Views: 1009
Reputation: 21492
The intersection of two lines is found analytically by solving the two linear equations which define the lines. I'll leave the math as an exercise to the OP.
If you want to use a very helpful and powerful package, you could read up on the package spatstat
. Once you've converted your lines into psp
objects, use spatstat:crossing.psp
to find intersections.
Upvotes: 2