예제 #1
0
        public void TestEquals()
        {
            Geodetic2D a = new Geodetic2D(1.0, 2.0);
            Geodetic2D b = new Geodetic2D(2.0, 3.0);
            Geodetic2D c = new Geodetic2D(2.0, 3.0);

            object objA = a;
            object objB = b;
            object objC = c;

            Assert.IsTrue(a.Equals(a));
            Assert.IsTrue(b.Equals(c));
            Assert.IsTrue(a.Equals(objA));
            Assert.IsTrue(b.Equals(objC));
            Assert.IsTrue(objA.Equals(objA));
            Assert.IsTrue(objB.Equals(objC));

            Assert.IsTrue(b == c);
            Assert.IsTrue(c == b);
            Assert.IsTrue(a != b);

            Assert.IsFalse(a.Equals(b));
            Assert.IsFalse(a.Equals(c));

            Assert.IsFalse(a.Equals(objB));
            Assert.IsFalse(a.Equals(objC));

            Assert.IsFalse(objA.Equals(objB));
            Assert.IsFalse(objA.Equals(objC));

            Assert.IsFalse(a == b);
            Assert.IsFalse(a == c);
            Assert.IsFalse(b != c);

            Assert.IsFalse(a.Equals(null));
            Assert.IsFalse(a.Equals(5));
        }
예제 #2
0
 public static Geodetic2D ToDegrees(Geodetic2D geodetic)
 {
     return(new Geodetic2D(ToDegrees(geodetic.Longitude), ToDegrees(geodetic.Latitude)));
 }
예제 #3
0
 public Geodetic3D(Geodetic2D geodetic2D, double height)
 {
     _longitude = geodetic2D.Longitude;
     _latitude  = geodetic2D.Latitude;
     _height    = height;
 }
예제 #4
0
 public Vector3D ToVector3D(Geodetic2D geodetic)
 {
     return(ToVector3D(new Geodetic3D(geodetic.Longitude, geodetic.Latitude, 0.0)));
 }
예제 #5
0
 public Geodetic3D(Geodetic2D geodetic2D)
 {
     _longitude = geodetic2D.Longitude;
     _latitude  = geodetic2D.Latitude;
     _height    = 0;
 }