Project 2: Intersection of any two Lines

In project 1, we determined the intersection point with two "sloped" lines (not horizontal or vertical).  Remember the slope of a vertical line is undefined.  In this project, we will extend this idea to horizontal and vertical lines as well.

Project 2:  Variables 'a', 'b', 'c', 'd', 'e', 'f' have been initialized.   There are also working methods called slopedIntersectionX and slopedIntersectionY

a,b,c represent the coefficients of Line 1 in standard form (as shown above)

d,e,f represent the coefficients of Line 2 in standard form (as shown above)

slopedIntersectionX(m1, b1, m2, b2) returns the x-coordinate of the intersection point given that m1, b1, m2, b2 are the slopes and y-intercepts of both lines

slopedIntersectionY(m1, b1, m2, b2) returns the y-coordinate of the intersection point given that m1, b1, m2, b2 are the slopes and y-intercepts of both lines

Important:  It is possible that either b = 0 (Line 1 is a vertical line) and/or d = 0 (Line 2 is a horizontal line).  It is also possible that neither 'b' nor 'd' are 0 (which means both lines are "sloped")


Task: Appropriately initialize the values of 'x' and 'y' which represent the coordinates of the intersection point of the two lines.

**If your code works for 5 test cases in a row, you can enter your e-mail address.