Ejemplo n.º 1
0
        public void Intersection2()
        {
            var intersect = VecmathUtil.Intersection(new Vector2(6, 1), new Vector2(-4, -2), new Vector2(1, 6), new Vector2(2, 4));

            Assert.AreEqual(-4, intersect.X, 0.01);
            Assert.AreEqual(-4, intersect.Y, 0.01);
        }
Ejemplo n.º 2
0
        public void ParallelLines()
        {
            var intersect = VecmathUtil.Intersection(new Vector2(0, 1), new Vector2(0, 1), new Vector2(0, -1), new Vector2(0, 1));

            Assert.IsTrue(double.IsNaN(intersect.X));
            Assert.IsTrue(double.IsNaN(intersect.Y));
        }
Ejemplo n.º 3
0
        public void Intersection1()
        {
            var intersect = VecmathUtil.Intersection(new Vector2(1, 1), new Vector2(0, 1), new Vector2(1, 0), new Vector2(1, 0));

            Assert.AreEqual(1, intersect.X, 0.01);
            Assert.AreEqual(0, intersect.Y, 0.01);
        }