Project 6: Intersection of any Two Lines

In project 5, 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 6:  Variables 'a', 'b', 'c', 'd', 'e', and '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, you can enter your e-mail address

Universal Computational Math Methods:

pow(5,2) returns 25.0

abs(-3.0) returns 3

sqrt(49.0) returns 7.0