public void IntersectionBetweenLines2() { var line1 = new KtLine3D(new KtPoint3D(6, 8, 4), (new KtPoint3D(12, 15, 4) - new KtPoint3D(6, 8, 4)).ToKtVector3D()); var line2 = new KtLine3D(new KtPoint3D(6, 8, 2), (new KtPoint3D(12, 15, 6) - new KtPoint3D(6, 8, 2)).ToKtVector3D()); var(a, b) = line2.Intersect2(line1); var expected = new KtPoint3D(9, 23d / 2, 4); Assert.AreEqual(a, expected); Assert.AreEqual(b, expected); }
public double Evaluate(KtPoint3D point) => point is null ? -D : (A * point.X) + (B * point.Y) + (C * point.Z) - D;