Ejemplo n.º 1
0
        /// <summary>
        /// Create line with geo coordinates.
        /// </summary>
        /// <param name="GeoCoordinate1">A geo coordinate.</param>
        /// <param name="GeoVector">A geo vector.</param>
        public GeoLine(GeoCoordinate GeoCoordinate1, GeoVector GeoVector)
        {
            #region Initial Checks

            if (GeoCoordinate1 == null)
            {
                throw new ArgumentNullException("The given left-coordinate must not be null!");
            }

            if (GeoVector == null)
            {
                throw new ArgumentNullException("The given right-coordinate must not be null!");
            }

            #endregion

            this.P1 = GeoCoordinate1;
            this.P2 = new GeoCoordinate(
                Latitude.Parse(GeoCoordinate1.Latitude.Value + GeoVector.P.Latitude.Value),
                Longitude.Parse(GeoCoordinate1.Longitude.Value + GeoVector.P.Longitude.Value)
                );

            this.Length = GeoCoordinate1.DistanceTo(P2);
            this.Tags   = new List <String>();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create line with geo coordinates.
        /// </summary>
        /// <param name="GeoCoordinate1">A geo coordinate.</param>
        /// <param name="GeoCoordinate2">A geo coordinate.</param>
        public GeoLine(GeoCoordinate GeoCoordinate1, GeoCoordinate GeoCoordinate2)
        {
            #region Initial Checks

            if (GeoCoordinate1 == null)
            {
                throw new ArgumentNullException("The given left-coordinate must not be null!");
            }

            if (GeoCoordinate2 == null)
            {
                throw new ArgumentNullException("The given right-coordinate must not be null!");
            }

            #endregion

            this.P1     = GeoCoordinate1;
            this.P2     = GeoCoordinate2;
            this.Length = GeoCoordinate1.DistanceTo(GeoCoordinate2);
            this.Tags   = new List <String>();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a 2-dimensional vector of type T.
        /// </summary>
        /// <param name="GeoCoordinate1">A pixel of type T.</param>
        /// <param name="GeoCoordinate2">A pixel of type T.</param>
        public GeoVector(GeoCoordinate GeoCoordinate1, GeoCoordinate GeoCoordinate2)
        {
            #region Initial Checks

            if (GeoCoordinate1 == null)
            {
                throw new ArgumentNullException("The first pixel must not be null!");
            }

            if (GeoCoordinate2 == null)
            {
                throw new ArgumentNullException("The second pixel must not be null!");
            }

            #endregion

            this.P = new GeoCoordinate(new Latitude(GeoCoordinate1.Latitude.Value - GeoCoordinate2.Latitude.Value),
                                       new Longitude(GeoCoordinate1.Longitude.Value - GeoCoordinate2.Longitude.Value));

            this.Length = GeoCoordinate1.DistanceTo(GeoCoordinate2);
        }