public void Circle() { var center = Turf.Point(new double[] { -75.343, 39.984 }); double radius = 5; int steps = 10; var polygon = Turf.Circle(center, radius, steps, "kilometers"); var point1 = Turf.Destination(center, radius - 1, 45, "kilometers"); var point2 = Turf.Destination(center, radius + 1, 135, "kilometers"); Assert.AreEqual(Turf.Inside(point1, polygon), true, "point is inside the polygon"); Assert.AreEqual(Turf.Inside(point2, polygon), false, "point is outside the polygon"); }
public void Destination() { var pt1 = Turf.Point(new double[] { -75.0, 39.0 }); double dist = 100; double bear = 180; var pt2 = Turf.Destination(pt1, dist, bear, "kilometers"); var ptgeom = (Point)pt2.Geometry; var prcoord = (GeographicPosition)ptgeom.Coordinates; Assert.AreEqual(prcoord.Longitude, -75, 0.001, "returns the correct point"); Assert.AreEqual(prcoord.Latitude, 38.10096062273525, 0.001, "returns the correct point"); Assert.AreEqual(ptgeom.Type, GeoJSONObjectType.Point, "returns the correct point"); }