コード例 #1
0
 private void menuItemClear_Click(object sender, RoutedEventArgs e)
 {
     pf               = new PolyFunc();
     dih              = new Lagranje();
     combo            = new Newton();
     textBoxXMin.Text = "-10";
     textBoxXMax.Text = "10";
     textBoxYMin.Text = "-10";
     textBoxYMax.Text = "10";
     textBoxSols.Text = "";
 }
コード例 #2
0
ファイル: FunctionTest.cs プロジェクト: SAProgClub/BulletHell
        public static void Main()
        {
            PolyFunc <double, double>           l1    = new PolyFunc <double, double>(1);
            PolyFunc <double, double>           l2    = new PolyFunc <double, double>(2);
            IntegrableFunction <double, double> split = IntegrableFunction <double, double> .SplitAt(l1, 2, l2, false);

            for (double d = 0; d < 5; d += 0.1)
            {
                Console.WriteLine("<{0},{1},{2},{3},{4}>", d, l1.F(d), l2.F(d), split.F(d), split.FI(d));
            }
            Console.ReadKey();
        }
コード例 #3
0
 private void menuItemClear_Click(object sender, RoutedEventArgs e)
 {
     pf               = new PolyFunc();
     gold             = new GoldenAxeEffect();
     cubic            = new CubicRubic();
     textBoxEps.Text  = "0,01";
     textBoxXMin.Text = "-10";
     textBoxXMax.Text = "10";
     textBoxYMin.Text = "-10";
     textBoxYMax.Text = "10";
     textBoxFunc.Text = "";
     textBoxSols.Text = "";
 }
コード例 #4
0
 private void menuItemClear_Click(object sender, RoutedEventArgs e)
 {
     pf               = new PolyFunc();
     dih              = new DihMethod();
     combo            = new CombinedMethod();
     textBoxEps.Text  = "0,01";
     textBoxXMin.Text = "-10";
     textBoxXMax.Text = "10";
     textBoxYMin.Text = "-10";
     textBoxYMax.Text = "10";
     textBoxFunc.Text = "";
     textBoxSols.Text = "";
 }
コード例 #5
0
ファイル: MainChar.cs プロジェクト: SAProgClub/BulletHell
        public MainChar(Drawable d, BulletStyle sty, double x0, double y0, double s = 20, GraphicsStyle g = null) : base(0, null, d, new Point(2), new EntityClass("MainChar", "Character"), null, g)
        {
            speed    = s;
            this.x0  = x0;
            this.y0  = y0;
            vxf      = new PolyFunc <double, double>(0);
            vyf      = new PolyFunc <double, double>(0);
            xp       = t => x0;
            yp       = t => y0;
            Position = new Particle(t => xp(t), t => yp(t));
            BulletEmission em = new BulletEmission(0, 0.25,
                                                   sty,
                                                   TrajectoryFactory.SimpleVel(2, -40, 5),
                                                   TrajectoryFactory.SimpleVel(-2, -40, -5)
                                                   );

            BulletPattern pat = new BulletPattern(new EntityClass("MainCharBullet", "Bullet"), em);

            Emitter = new BulletEmitter(-1, pat);
            Time    = 0;
        }
コード例 #6
0
        private void menuItemOpen_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                OpenFileDialog ofd = new OpenFileDialog();
                ofd.Multiselect      = false;
                ofd.Filter           = "XML data file (*.xml)|*.xml|All files|*.*";
                ofd.InitialDirectory = Environment.CurrentDirectory;
                ofd.DefaultExt       = "*.xml";
                ofd.CheckPathExists  = true;

                SerializedFunc sf = new SerializedFunc();
                if (ofd.ShowDialog() == true)
                {
                    try
                    {
                        sf.Read(ofd.FileName);
                        filePath = ofd.FileName;
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Ошибка чтения с файла", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }

                menuItemClear_Click(sender, new RoutedEventArgs());
                pf = sf.pf;
                textBoxEps.Text  = sf.eps;
                textBoxXMin.Text = sf.xMin;
                textBoxXMax.Text = sf.xMax;
                textBoxYMin.Text = sf.yMin;
                textBoxYMax.Text = sf.yMax;
                textBoxFunc.Text = pf.StringFunction;
                textBoxSols.Text = "";
                buttonDraw_Click(sender, new RoutedEventArgs());
            }
            catch
            {
            }
        }
コード例 #7
0
 public void Clear()
 {
     pf = new PolyFunc();
     Solutions.Clear();
     Log.Clear();
 }
コード例 #8
0
 public Newton()
 {
     pf        = new PolyFunc();
     Solutions = new List <double>();
     Log       = new List <string>();
 }
コード例 #9
0
 public CombinedMethod()
 {
     pf        = new PolyFunc();
     Solutions = new List <double>();
     Log       = new List <string>();
 }