{"ScriptPreparationCode":"var sq = function (a) {\r\n return a * a;\r\n};\r\n\r\nfunction isOnLine1(p, v, w) {\r\n if (v[0] == w[0] \u0026\u0026 p[0] == v[0]\r\n || v[1] == w[1] \u0026\u0026 p[1] == w[1]\r\n || v[0] == w[0] \u0026\u0026 v[1] == w[1]) return true;\r\n var yDiff = Math.abs(p[1] - v[1] - (w[1] - v[1]) * ((p[0] - v[0]) / (w[0] - v[0])));\r\n var xDiff = Math.abs(p[0] - v[0] - (w[0] - v[0]) * ((p[1] - v[1]) / (w[1] - v[1])));\r\n\r\n var distance = yDiff \u003C xDiff ? yDiff : xDiff; // off by a factor of at most ~0.707 = 1 / sqrt(2)\r\n return distance \u003C 0.0017; // fp errors\r\n}\r\n\r\nfunction isOnLine2(p, v, w) {\r\n var distance = ((Math.abs((w[1] - v[1]) * p[0] -\r\n (w[0] - v[0]) * p[1] \u002B\r\n w[0] * v[1] -\r\n w[1] * v[0])) /\r\n (Math.sqrt(sq(w[1] - v[1]) \u002B\r\n sq(w[0] - v[0]))));\r\n return distance \u003C 0.001; // fp errors\r\n}\r\nvar a = false;","TestCases":[{"Name":"new","Code":"a = isOnLine1([54.34523], [543.23], [123.3]);","IsDeferred":false},{"Name":"old","Code":"a = isOnLine2([54.34523], [543.23], [123.3]);","IsDeferred":false}]}