Exemple #1
0
 private static void GetXYOffset(GeoXYLine tempGeoXYLine, double precision, ref double xOffSetValue, ref double yOffSetValue)
 {
     double a = 0.0;
     a = tempGeoXYLine.GetAzimuthofLine();
     xOffSetValue = Math.Abs((double) (precision * Math.Sin(a)));
     yOffSetValue = Math.Abs((double) (precision * Math.Cos(a)));
 }
Exemple #2
0
 public short[] GetValueByGeoXYLine(List<GeoXYPoint> pointInGeoXYLine, GeoXYPoint geoXYPointStart, GeoXYPoint geoXYPointEnd, double precision, bool isDivInsert)
 {
     GeoXYLine line = new GeoXYLine(geoXYPointStart, geoXYPointEnd);
     double distance = line.GetDistance();
     int num2 = ((int) Math.Ceiling((double) (distance / precision))) + 1;
     int num3 = (geoXYPointEnd.X > geoXYPointStart.X) ? 1 : -1;
     int num4 = (geoXYPointEnd.Y > geoXYPointStart.Y) ? 1 : -1;
     double num5 = distance / ((double) (num2 - 1));
     double azimuthofLine = line.GetAzimuthofLine();
     List<short> list = new List<short>();
     for (int i = 0; i < num2; i++)
     {
         double num7 = num5 * i;
         double num8 = Math.Abs((double) (num7 * Math.Sin(azimuthofLine)));
         double num9 = Math.Abs((double) (num7 * Math.Cos(azimuthofLine)));
         double x = geoXYPointStart.X + (num3 * num8);
         double y = geoXYPointStart.Y + (num4 * num9);
         list.Add(this.GetValueByGeoXYPoint(x, y, isDivInsert));
         GeoXYPoint item = new GeoXYPoint(x, y);
         pointInGeoXYLine.Add(item);
     }
     return list.ToArray();
 }