public void TestNotSameProjection() { var e1 = new EuclidianCoordinate(projection, -3, -4); var e2 = new EuclidianCoordinate(new EllipticalMercatorProjection(), -3, -4); Assert.ThrowsException <ArgumentException>(() => e1.DistanceTo(e2)); }
/// <summary> /// Compute the euclidian distance between two points given by rectangular coordinates /// Please note, that due to scaling effects this might be quite different from the true /// geodetic distance. To get a good approximation, you must divide this value by a /// scale factor. /// </summary> /// <param name="point1">The first point</param> /// <param name="point2">The second point</param> /// <returns>The distance between the points</returns> /// <exception cref="ArgumentNullException"></exception> /// <exception cref="ArgumentException"></exception> public double EuclidianDistance(EuclidianCoordinate point1, EuclidianCoordinate point2) { if (point1 is null || point2 is null) { throw new ArgumentNullException(); } if (!(point1.Projection.Equals(this) && point2.Projection.Equals(this))) { throw new ArgumentException(Properties.Resources.POINT_NOT_OWNED); } return(point1.DistanceTo(point2)); }
public void TestNotSameProjection() { var e1 = new EuclidianCoordinate(projection, -3, -4); var e2 = new EuclidianCoordinate(new EllipticalMercatorProjection(), -3, -4); var d = e1.DistanceTo(e2); }