コード例 #1
0
        public void InsideRectangle()
        {
            bool inside = VectorUtil.InsideRectangle(new Vector(1, 2), new Vector(-1, 3), new Vector(4, 0));

            Assert.AreEqual(true, inside);

            bool outside = VectorUtil.InsideRectangle(new Vector(1, 2), new Vector(2, 3), new Vector(4, 0));

            Assert.AreEqual(false, outside);

            bool onEdge = VectorUtil.InsideRectangle(new Vector(1, 2), new Vector(1, 3), new Vector(4, 0));

            Assert.AreEqual(false, onEdge);
        }