当前位置: 首页>>代码示例>>C#>>正文


C# IPoint.GetLength方法代码示例

本文整理汇总了C#中IPoint.GetLength方法的典型用法代码示例。如果您正苦于以下问题:C# IPoint.GetLength方法的具体用法?C# IPoint.GetLength怎么用?C# IPoint.GetLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPoint的用法示例。


在下文中一共展示了IPoint.GetLength方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ComputeShapeDistortionParameters

        private bool ComputeShapeDistortionParameters(IPoint[] FabricPoints, IPoint[] AdjustedTraversePoints, out double RotationInRadians,
      out double Scale, out double ShpStdErrX, out double ShpStdErrY)
        {
            Scale = 1;
              RotationInRadians = 0;
              ShpStdErrX = 0;
              ShpStdErrY = 0;
              IAffineTransformation2D3GEN affineTransformation2D = new AffineTransformation2DClass();
              try { affineTransformation2D.DefineConformalFromControlPoints(ref FabricPoints, ref AdjustedTraversePoints); }
              catch { return false; }

              RotationInRadians = affineTransformation2D.Rotation;
              Scale = affineTransformation2D.XScale;
              Scale = affineTransformation2D.YScale;
              Scale = 1 / Scale; //the inverse of this computed scale is stored

              int iLen = FabricPoints.GetLength(0) * 2;
              double[] inPoints = new double[iLen];
              double[] outPoints = new double[iLen];
              double[] adjTrav = new double[iLen];

              int x = 0;
              int y = 0;
              for (int j = 0; j < FabricPoints.GetLength(0); j++)
              {
            x = j * 2;
            y = x + 1;
            inPoints[x] = FabricPoints[j].X;//x
            inPoints[y] = FabricPoints[j].Y;//y

            adjTrav[x] = AdjustedTraversePoints[j].X;//x
            adjTrav[y] = AdjustedTraversePoints[j].Y;//y
              }

              affineTransformation2D.TransformPointsFF(esriTransformDirection.esriTransformForward, ref inPoints, ref outPoints);

              //now build a list of the diffs for x and y between transformed and the AdjustedTraverse Results

              int iLen2 = FabricPoints.GetLength(0);
              double[] errX = new double[iLen2];
              double[] errY = new double[iLen2];
              x = 0;
              y = 0;
              double dSUMX = 0;
              double dSUMY = 0;

              for (int j = 0; j < iLen2; j++)
              {
            x = j * 2;
            y = x + 1;
            errX[j] = adjTrav[x] - outPoints[x] + 100000;//x
            errY[j] = adjTrav[y] - outPoints[y] + 100000;//y
            dSUMX += errX[j];
            dSUMY += errY[j];
              }
              double dMean = 0; double dStdDevX = 0; double dStdDevY = 0; double dRange; int iOutliers = 0;
              GetStatistics(errX, dSUMX, 1, out dMean, out dStdDevX, out dRange, out iOutliers);
              GetStatistics(errY, dSUMY, 1, out dMean, out dStdDevY, out dRange, out iOutliers);
              ShpStdErrX = dStdDevX;
              ShpStdErrY = dStdDevY;

              return true;
        }
开发者ID:Esri,项目名称:parcel-fabric-desktop-addins,代码行数:63,代码来源:Utilities.cs


注:本文中的IPoint.GetLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。