igniteui-react-core
Version:
Ignite UI React Core.
42 lines (41 loc) • 1.7 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, Point_$type, markType } from "./type";
import { LineEquation } from "./LineEquation";
/**
* @hidden
*/
export let Compute = /*@__PURE__*/ (() => {
class Compute extends Base {
static b(a, b, c, d) {
return Compute.a(new LineEquation(1, a, b), new LineEquation(1, c, d));
}
static a(a, b) {
let c = { $type: Point_$type, x: NaN, y: NaN };
if (a.a && b.a) {
return c;
}
if (a.a || b.a) {
let d = b.a ? b : a;
let e = b.a ? a : b;
let f = (d.g.x - e.g.x) * (e.f.y - e.g.y) / (e.f.x - e.g.x) + e.g.y;
let g = a.a ? a.g.x : b.g.x;
return { $type: Point_$type, x: g, y: f };
}
let h = a.b * b.c - b.b * a.c;
let i = Math.abs(h - 0) > 9.9999997473787516E-05;
if (i) {
let j = (b.c * a.d - a.c * b.d) / h;
let k = (a.b * b.d - b.b * a.d) / h;
c = { $type: Point_$type, x: j, y: k };
}
return c;
}
}
Compute.$t = /*@__PURE__*/ markType(Compute, 'Compute');
return Compute;
})();