Khan/khan-exercises — pull request #8303 by smenks13 (2011-12-10 17:53:41+00:00)
Title: Graphing systems of inequalities 2: Generate solution point more often

@beneater, here's my attempt at making a solution point come up more frequently as one of the candidate points. What it does is starts at the intersection of the lines, then moves outward into the solution area based on the slopes and orientations of the lines. If the point it comes up with has one of the restricted values for x and y (which you put in for labeling purposes i'm assuming), then it returns a random point which will likely not be a solution.

this also got me to thinking, might the reason that the old one failed on occasion be due to the fact that no solution point could be found where the x and y values were outside that restricted area? i can envision a case where the entire solution area is between x = -3 and x = 0.

my code could probably be improved as well by making this new point something called "Point 3", and having point 1 and point 2 alternate in assuming its value to make sure point 1 is a solution a portion of the time.

it's kind of long and cumbersome, but it should come up with a solution fairly quickly. thanks!