Exemplo n.º 1
0
 // -------------------------------------------------        OnPaint
 private void OnPaint (object sender, PaintEventArgs e)
 {
     Graphics grfx = e.Graphics;
     MSPlotAuxi auxi = new MSPlotAuxi (0, 0, 0, SegmentLocation .Anywhere);
     //FullGrArea_AuxiDraw fgad = new FullGrArea_AuxiDraw (new Pen (Color .Blue), SegmentLocation .Partly_Inside);
     for (int i = 0; i < nTypes; i++)
     {
         grfx .DrawRectangles (Pens .DarkGray, rc);
     }
     plot [0] .DrawYofX (grfx, auxi, Math .Sin);
     plot [1] .DrawYofX (grfx, auxi, Math .Cos);
     plot [2] .DrawYofX (grfx, auxi, Math .Tanh);
     plot [3] .DrawYofX (grfx, auxi, Math .Asin);
     plot [4] .DrawYofX (grfx, auxi, Math .Acos);
     plot [5] .DrawYofX (grfx, auxi, Math .Atan);
     plot [6] .DrawYofX (grfx, auxi, Sample_Func .sinAsinB, new double [2] { 14, 1 });
     plot [7] .DrawYofX (grfx, auxi, Sample_Func .RepeatDampedVibrations, new double [] { 3, 2, 10 });
     plot [8] .DrawYofX (grfx, auxi, Sample_Func .NormalDistribution, new double [2] { 0.8, 0.5 });
     auxi .ParamTrio (0.0, 29.0, 0.02);
     plot [9] .DrawParamFunc (grfx, auxi, Sample_Func .ParamFunc_X_0, Sample_Func .ParamFunc_Y_0);
     auxi .ParamTrio (-7.5, 7.5, 0.02);
     plot [10] .DrawParamFunc (grfx, auxi, Sample_Func .ParamFunc_X_1, Sample_Func .ParamFunc_Y_1);
     auxi .ParamTrio (-4.0, 4.0, 0.01);
     plot [11] .DrawParamFunc (grfx, auxi, Sample_Func .ParamFunc_X_2, Sample_Func .ParamFunc_Y_2);
     auxi .ParamTrio (0.0, 20.0, 0.02);
     plot [12] .DrawParamFunc (grfx, auxi, Sample_Func .Lissajou_Param_X, Sample_Func .Lissajou_Param_Y);
     auxi .ParamTrio (-2.5, 2.5, 0.005);
     plot [13] .DrawParamFunc (grfx, auxi, Sample_Func .ParamFunc_X_4, Sample_Func .ParamFunc_Y_4);
     auxi .ParamTrio (0.0, 2.1 * Math .PI, 0.01);
     plot [14] .DrawParamFunc (grfx, auxi, Sample_Func .ParamFunc_X_5, Sample_Func .ParamFunc_Y_5);
     plot [15] .DrawYofX (grfx, auxi, Math .Sin);
     auxi .PenOrder = 1; // .PenColor = Color .Red;
     plot [15] .DrawYofX (grfx, auxi, Math .Cos);
 }
Exemplo n.º 2
0
        // -------------------------------------------------        DrawFunc
        public void DrawFunc (Graphics grfx)
        {
            double [] fParams;
            MSPlotAuxi msad = new MSPlotAuxi (0, SegmentLocation .Partly_Inside);

            switch (Type)
            {
                case DemoFuncType .Sine:
                    plot .DrawYofX (grfx, msad, Math .Sin);
                    break;
                case DemoFuncType .Cosine:
                    plot .DrawYofX (grfx, msad, Math .Cos);
                    break;
                case DemoFuncType .HiperbolicTangent:
                    plot .DrawYofX (grfx, msad, Math .Tanh);
                    break;
                case DemoFuncType .Arcsine:
                    plot .DrawYofX (grfx, msad, Math .Asin);
                    break;
                case DemoFuncType .Arccosine:
                    plot .DrawYofX (grfx, msad, Math .Acos);
                    break;
                case DemoFuncType .Arctangent:
                    plot .DrawYofX (grfx, msad, Math .Atan);
                    break;
                case DemoFuncType .SinSin:
                    fParams = new double [2] { 14, 1 };
                    plot .DrawYofX (grfx, msad, Sample_Func .sinAsinB, fParams);
                    break;
                case DemoFuncType .DampedVibrations:
                    fParams = new double [] { 3, 2, 10 };
                    plot .DrawYofX (grfx, msad, Sample_Func .RepeatDampedVibrations, fParams);
                    break;
                case DemoFuncType .Distribution:
                    fParams = new double [2] { 0.8, 0.5 };
                    plot .DrawYofX (grfx, msad, Sample_Func .NormalDistribution, fParams);
                    break;
                case DemoFuncType .Parametric_0:
                    msad .ParamTrio (0.0, 29.0, 0.02);
                    plot .DrawParamFunc (grfx, msad, Sample_Func .ParamFunc_X_0, Sample_Func .ParamFunc_Y_0);
                    break;
                case DemoFuncType .Parametric_1:
                    msad .ParamTrio (-7.5, 7.5, 0.02);
                    plot .DrawParamFunc (grfx, msad, Sample_Func .ParamFunc_X_1, Sample_Func .ParamFunc_Y_1);
                    break;
                case DemoFuncType .Parametric_2:
                    msad .ParamTrio (-4.0, 4.0, 0.01);
                    plot .DrawParamFunc (grfx, msad, Sample_Func .ParamFunc_X_2, Sample_Func .ParamFunc_Y_2);
                    break;
                case DemoFuncType .Lissajou:
                    msad .ParamTrio (0.0, 20.0, 0.02);
                    plot .DrawParamFunc (grfx, msad, Sample_Func .Lissajou_Param_X, Sample_Func .Lissajou_Param_Y);
                    break;
                case DemoFuncType .Parametric_4:
                    msad .ParamTrio (-2.5, 2.5, 0.005);
                    plot .DrawParamFunc (grfx, msad, Sample_Func .ParamFunc_X_4, Sample_Func .ParamFunc_Y_4);
                    break;
                case DemoFuncType .Parametric_5:
                    msad .ParamTrio (0.0, 6.29, 0.01);
                    plot .DrawParamFunc (grfx, msad, Sample_Func .ParamFunc_X_5, Sample_Func .ParamFunc_Y_5);
                    break;
                case DemoFuncType .Trigonometric_0:
                    plot .DrawYofX (grfx, msad, Math .Sin);
                    msad .PenOrder = 1;
                    plot .DrawYofX (grfx, msad, Math .Cos);
                    break;
            }
        }