Esempio n. 1
0
    /// <summary>
    /// スプライン補間 2回目
    /// 垂直方向に見ていく
    /// </summary>
    void Analysis_Step2(string _id)
    {
        //1回目の補間で全ての列に値が入っている。
        //(スポンジのある行の部分)
        //その値を基に全ての列でスプライン補間を行う。

        // P7  @ P8  @ P9
        //  *  *  *  *  *
        // P4  @ P5  @ P6
        //  *  *  *  *  *
        // P1  @ P2  @ P3
        // ↑ ↑ ↑ ↑ ↑ ※@の部分は1回目の補間で取得済み

        //20 21 22 23 24
        //15 16 17 18 19
        //10 11 12 13 14
        // 5  6  7  8  9
        // 0  1  2  3  4
        // ↑ ↑ ↑ ↑ ↑



        SpongeInfo _info = GetSpongeInfo(_id);

        float[] Input_x  = new float[] { Matrix_dist[0], Matrix_dist[2], Matrix_dist[4] }; //スプライン補間を行うデータ(x) ※インプットデータに対応する場所は決まっているので固定
        float[] Input_y  = new float[3];                                                   //スプライン補間を行うデータ(y)
        float[] Output_y = new float[Matrix_y];                                            //スプライン補間より取得したデータ


        //x座標をスプライン補間クラスに渡す
        ns_Spline._Def_Spline _spline = new ns_Spline._Def_Spline(3, Matrix_dist);


        //行にあるスポンジの個数分繰り返す。
        for (int p = 0; p < Matrix_x; p++)
        {
            Input_y = new float[] { _info.ch[p], _info.ch[p + 10], _info.ch[p + 20] };
            //スプライン補間
            _spline.Func_MainSpline(Input_x, Input_y, ref Output_y);
            //SpongeInfoに反映
            int i = 0;
            foreach (float f in Output_y)
            {
                _info.ch[p + 5 * (i++)] = f;
            }
        }

        dictSpongeInfo[_id] = _info;
    }
Esempio n. 2
0
    /// <summary>
    ///スプライン補間 1回目
    ///水平方向に見ていく
    /// </summary>
    void Analysis_Step1(string _id)
    {
        // P7  * P8  * P9←
        //  *  *  *  *  *
        // P4  * P5  * P6←
        //  *  *  *  *  *
        // P1  * P2  * P3←

        //20 21 22 23 24←
        //15 16 17 18 19
        //10 11 12 13 14←
        // 5  6  7  8  9
        // 0  1  2  3  4←

        SpongeInfo _info = GetSpongeInfo(_id);

        float[] Input_x  = new float[] { Matrix_dist[0], Matrix_dist[2], Matrix_dist[4] }; //スプライン補間を行うデータ(x) ※インプットデータに対応する場所は決まっているので固定
        float[] Input_y  = new float[3];                                                   //スプライン補間を行うデータ(y)
        float[] Output_y = new float[Matrix_y];                                            //スプライン補間より取得したデータ


        //x座標をスプライン補間クラスに渡す
        ns_Spline._Def_Spline _spline = new ns_Spline._Def_Spline(3, Matrix_dist);


        //行にあるスポンジの個数分繰り返す。

        for (int p = 0; p < 9; p += 3)
        {
            Input_y = new float[] { _info.ch[BasePos[p]], _info.ch[BasePos[p + 1]], _info.ch[BasePos[p + 2]] };
            //スプライン補間
            _spline.Func_MainSpline(Input_x, Input_y, ref Output_y);
            //SpongeInfoに反映
            int i = (int)(p / 3) * 10;
            foreach (float f in Output_y)
            {
                _info.ch[i++] = f;
            }
        }

        dictSpongeInfo[_id] = _info;
    }