예제 #1
0
        public void DistanceFromPath_Path(TestPoint point, float expectedDistance, float alongPath)
        {
            var       path = new Path(new LinearLineSegment(new PointF(0, 0), new PointF(10, 0), new PointF(10, 10), new PointF(0, 10)));
            PointInfo info = path.Distance(point);

            Assert.Equal(expectedDistance, info.DistanceFromPath);
            Assert.Equal(alongPath, info.DistanceAlongPath);
        }
        public void DistanceFromPath_Path(TestPoint point, float expectecDistance, float alongPath)
        {
            IPath     shape = new RectangularPolygon(0, 0, 10, 10);
            PointInfo info  = shape.Distance(point);

            Assert.Equal(expectecDistance, info.DistanceFromPath);
            Assert.Equal(alongPath, info.DistanceAlongPath);
        }
예제 #3
0
        public void DistanceFromPath_Path(TestPoint point, float expectedDistance, float alongPath)
        {
            InternalPath shape = Create(new PointF(0, 0), new Size(10, 10));
            PointInfo    info  = shape.DistanceFromPath(point);

            Assert.Equal(expectedDistance, info.DistanceFromPath);
            Assert.Equal(alongPath, info.DistanceAlongPath);
        }
예제 #4
0
        public void Distance(TestPoint[] controlPoints, TestPoint point, float expected)
        {
            var shape = new Polygon(new LinearLineSegment(controlPoints.Select(x => (PointF)x).ToArray()));

            Assert.Equal(expected, shape.Distance(point).DistanceFromPath);
        }
예제 #5
0
        public void PointInPolygon(TestPoint[] controlPoints, TestPoint point, bool isInside)
        {
            var shape = new Polygon(new LinearLineSegment(controlPoints.Select(x => (PointF)x).ToArray()));

            Assert.Equal(isInside, shape.Contains(point));
        }
        public void Distance(TestPoint location, TestSize size, TestPoint point, float expectecDistance)
        {
            IPath shape = new RectangularPolygon(location, size);

            Assert.Equal(expectecDistance, shape.Distance(point).DistanceFromPath);
        }
        public void PointInPolygon(TestPoint location, TestSize size, TestPoint point, bool isInside)
        {
            var shape = new RectangularPolygon(location, size);

            Assert.Equal(isInside, shape.Contains(point));
        }
예제 #8
0
        public void PointInPolygon(TestPoint location, TestSize size, TestPoint point, bool isInside)
        {
            InternalPath shape = Create(location, size);

            Assert.Equal(isInside, shape.PointInPolygon(point));
        }