normal1-->(-0.0034999,0.0,-2.493929)-->One[] normal2-->(-1.0,0.0,-83.38241)-->Two[]
public static void Solve2LinearEqnsWith2Unknowns(double[] One, double[] Two, out double X, out double Y) { double term1 = (One[0] * Two[2]) - (Two[0] * One[2]); double term2 = (One[0] * Two[1]) - (Two[0] * One[1]); try { Y = term1 / term2; if (One[0] == 0) X = (Two[2] - (Two[1] * Y)) / Two[0]; else X = (One[2] - (One[1] * Y)) / One[0]; Y = double.IsNaN(Y) ? 0 : Y; X = double.IsNaN(X) ? 0 : X; } catch (DivideByZeroException exc) { throw new DivideByZeroException(exc.Message); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)