示例#1
0
        /// <summary>
        /// 参数估计
        /// </summary>
        /// <returns></returns>
        public PlainXyConvertParam Estimate()
        {
            var obsVector = new Vector(ObsCount);

            //构建观测向量
            for (int i = 0; i < CoordCount; i++)
            {
                int index = 2 * i;
                var oldXy = OldOrTobeConvertingXys[i];
                var newXy = NewOrTargedXys[i];
                obsVector[index + 0] = newXy.X - oldXy.X;
                obsVector[index + 1] = newXy.Y - oldXy.Y;
            }
            //构建系数阵
            Matrix coeffOfParam = new Matrix(ObsCount, 4);

            for (int i = 0; i < CoordCount; i++)
            {
                int index = 2 * i;
                var oldXy = OldOrTobeConvertingXys[i];
                //尺度因子,
                coeffOfParam[index + 0, 0] = 1;
                coeffOfParam[index + 1, 1] = 1;
                //转换参数,弧度
                coeffOfParam[index + 0, 2] = oldXy.X;
                coeffOfParam[index + 0, 3] = oldXy.Y;
                coeffOfParam[index + 1, 2] = oldXy.Y;
                coeffOfParam[index + 1, 3] = -oldXy.X;
            }


            AdjustObsMatrix obsMatrix = new AdjustObsMatrix();

            obsMatrix.SetCoefficient(coeffOfParam).SetObservation(obsVector);
            var adjuster = new ParamAdjuster();

            this.ResultMatrix = adjuster.Run(obsMatrix);
            var ested = ResultMatrix.Estimated;

            var result = new PlainXyConvertParam(new XY(ested[0], ested[1]), ested[2] * 1e6, ested[3] * CoordConsts.RadToSecMultiplier);

            return(result);
        }
示例#2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xyConvertParam"></param>
 public PlanXyConverter(PlainXyConvertParam xyConvertParam)
 {
     this.PlanXyConvertParam = xyConvertParam;
 }