automatic intersection calculation with two equations