示例#1
0
 public utmpos(utmpos pos)
 {
     this.x    = pos.x;
     this.y    = pos.y;
     this.zone = pos.zone;
     this.Tag  = null;
 }
示例#2
0
        public double GetBearing(utmpos b)
        {
            var y = b.y - this.y;
            var x = b.x - this.x;

            return((MathHelper.rad2deg * (Math.Atan2(x, y)) + 360) % 360);
        }
示例#3
0
        // polar to rectangular
        static utmpos newpos(utmpos input, double bearing, double distance)
        {
            double degN = 90 - bearing;

            if (degN < 0)
            {
                degN += 360;
            }
            double x = input.x + distance * Math.Cos(degN * MathHelper.deg2rad);
            double y = input.y + distance * Math.Sin(degN * MathHelper.deg2rad);

            return(new utmpos(x, y, input.zone));
        }
示例#4
0
 public double GetDistance(utmpos b)
 {
     return(Math.Sqrt(Math.Pow(Math.Abs(x - b.x), 2) + Math.Pow(Math.Abs(y - b.y), 2)));
 }