public void DistanceFromPath_Path(TestPoint point, float expectedDistance, float alongPath) { IPath path = new Polygon(new LinearLineSegment(new Vector2(0, 0), new Vector2(10, 0), new Vector2(10, 10), new Vector2(0, 10))).AsPath(); var info = path.Distance(point); Assert.Equal(expectedDistance, info.DistanceFromPath); Assert.Equal(alongPath, info.DistanceAlongPath); }
public void DistanceFromPath_Path(TestPoint point, float expectedDistance, float alongPath) { var shape = Create(new Vector2(0, 0), new Size(10, 10)); var info = shape.DistanceFromPath(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).AsPath(); PointInfo info = shape.Distance(point); Assert.Equal(expectecDistance, info.DistanceFromPath); Assert.Equal(alongPath, info.DistanceAlongPath); }
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 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); }
public void PointInPolygon(TestPoint location, TestSize size, TestPoint point, bool isInside) { var shape = Create(location, size); Assert.Equal(isInside, shape.PointInPolygon(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) { RectangularPolygon shape = new RectangularPolygon(location, size); Assert.Equal(isInside, shape.Contains(point)); }
public void Distance(TestPoint[] controlPoints, TestPoint point, float expected) { var shape = new Polygon(new LinearLineSegment(controlPoints.Select(x => (Vector2)x).ToArray())); Assert.Equal(expected, shape.Distance(point)); }
public void PointInPolygon(TestPoint[] controlPoints, TestPoint point, bool isInside) { var shape = new Polygon(new LinearLineSegment(controlPoints.Select(x => (Vector2)x).ToArray())); Assert.Equal(isInside, shape.Contains(point)); }
public void Distance(TestPoint location, TestSize size, TestPoint point, float expectecDistance) { IShape shape = new Rectangle(location, size); Assert.Equal(expectecDistance, shape.Distance(point)); }