Finds the point where 2 lines intersect, given lines as 2 parameters each (intercept b then slope m).
If the two lines are identical, it returns NAs. Note the check for both slopes being infinite (vertical lines).
This is vectorized: either pair can be vector if other pair is atomic, or both can be same length vectors.
1 | intersection.of.lines(b1, m1, b2, m2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.