コード例 #1
0
        public void IsPointOnLine_WhenGivenPointOnLine_ShouldReturnTrue()
        {
            var line = new[]
            {
                new Vector2(-5, 5),
                new Vector2(5, 5)
            };

            var point = new Vector2(2.5F, 5);

            var onLine = helper.IsOnLine(point, line);

            Assert.True(onLine);
        }
コード例 #2
0
        private bool IsOnPolygonLine(Vector2[] aFace, Vector2[][] linePairs)
        {
            for (int i = 0; i < aFace.Length; i++)
            {
                for (int j = 0; j < linePairs.Length; j++)
                {
                    if (helper.IsOnLine(aFace[i], linePairs[j]))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }