void Start()
    {
#if UNITY_ANDROID
        primeiroPoco = false;
        mobileButtons.SetActive(true);
        jaEnsinou = true;
#else
        primeiroPoco = true;
        mobileButtons.SetActive(false);
#endif
        if (Objetivo.obj == "Balde")
        {
            Objetivo.SetObjetivo("Rosa");
        }

        Pa.SetActive(Objetivo.obj == "Pá");
        planeta.transform.eulerAngles = Vector3.forward * rotaCheck;
        Time.timeScale = 1;
        level          = 0;
        contVulcao     = 0;
        tocaSons       = GameObject.FindWithTag("Sound");
        animator       = GetComponent <Animator>();
        renderer       = GetComponent <SpriteRenderer>();
        rbPlayer       = GetComponent <Rigidbody2D>();
        parar          = true;
        Invoke("NoParar", 6.5f);
    }
예제 #2
0
            internal void Start(string sen, int second, params ConsoleColor[] color)
            {
                Console.ResetColor();

                var printColor = Console.ForegroundColor;
                var progress   = 0;

                if (color.Length == 1)
                {
                    printColor = color[0];
                }
                var tPos = Console.CursorTop;

                if (Pa != null)
                {
                    tPos = TopPosAfterAa + 2;
                }

                Console.SetCursorPosition(0, tPos);
                Console.Write($@"{sen} [");
                var curLPos = sen.Length + 2;

                var random = new Random();

                while (progress <= second * 100)
                {
                    for (var i = 0; i < progress / second / 2; i++)
                    {
                        Console.SetCursorPosition(curLPos + i, tPos);
                        Console.ForegroundColor = printColor;
                        Console.Write(@"#");
                        Console.ResetColor();
                    }

                    Console.SetCursorPosition(curLPos + 50, tPos);
                    Console.Write($@"] {progress / second}%");
                    Console.SetCursorPosition(curLPos, tPos);
                    progress += random.Next(6, 15);

                    Pa?.Invoke(progress / second, printColor);

                    Thread.Sleep(100);
                }

                Console.SetCursorPosition(curLPos, tPos);
                for (var i = 0; i < 50; i++)
                {
                    Console.ForegroundColor = printColor;
                    Console.Write(@"#");
                    Console.ResetColor();
                }

                Console.Write(@"] Completed!");
            }
예제 #3
0
 public override string ToString()
 {
     return(string.Join(" ", new string[] {
         Date,
         T.ToString(),
         Po.ToString(),
         Pa.ToString(),
         U.ToString(),
         Ef.ToString(),
         Td.ToString(),
         RRR.ToString(),
     }));
 }
예제 #4
0
        public KalmanFilter()
        {
            pX     = &Xa;
            pXprev = &Xb;
            pP     = &Pa;
            pPprev = &Pb;

            Xa.zero();
            Xb.zero();

            Z.zero();

            F.zero();
            F[0][1] = 1.0f;
            F[1][2] = -1.0f;

            Phi.identity();            // Depends on time
            PhiTranspose.identity();   // Depends on time

            G.zero();
            G[1][0] = 1.0f;
            G[2][1] = 1.0f;
            GTranspose.zero();
            GTranspose[0][1] = 1.0f;
            GTranspose[1][2] = 1.0f;

            H.zero();
            H[0][0] = 1.0f;
            HTranspose.zero();
            HTranspose[0][0] = 1.0f;

            K.zero();            // gain
            // The above will not change for our filter. For a general filter they will.

            // These are the intial covariance estimates, feel free to muck with them.
            Pa.zero();
            Pa[0][0] = 0.05f * 0.05f;
            Pa[1][1] = 0.5f * 0.5f;
            Pa[2][2] = 10.0f * 10.0f;
            Pb       = Pa;

            // The following will change to appropriate values for noise.
            timePropNoiseVector[0]   = 0.01f;          // m / s^2
            timePropNoiseVector[1]   = 0.10f;          // m / s^2 / s
            measurmentNoiseVector[0] = 0.005f;         // =1/2 cm;
        }
예제 #5
0
        private protected override double GetDistance(Point P)
        {
            var r  = GetMagnetRadius();
            var Ta = Chart.WidthToTime(P.X - r);
            var Tb = Chart.WidthToTime(P.X + r);

            r /= 2;

            int a = 1; while (a < Data.Count && Data[a].TimeStamp < Ta)
            {
                a++;
            }
            int b = a; while (b < Data.Count && Data[b].TimeStamp < Tb)

            {
                b++;
            }
            b++;
            double A, dX, d; Point Pa, Pb; int k; Vector v;
            double min = Double.MaxValue;

            for (int i = a; i < Data.Count && i < b; i++)
            {
                Pa = Data[i - 1].ToPoint(Chart);
                Pb = Data[i].ToPoint(Chart);
                A  = Pa.GetCoeffsA(Pb);
                dX = r / Math.Sqrt(Math.Pow(A, 2) + 1);
                v  = new Vector(dX, A * dX);
                k  = (int)((Pb.X - Pa.X) / dX) + 1;
                while (k > 0)
                {
                    d = Pa.DistanceTo(P);
                    if (d < min)
                    {
                        min  = d;
                        MinP = Pa;
                    }
                    Pa += v; k--;
                }
            }
            return(min);
        }
예제 #6
0
        public async Task <IActionResult> Move([FromBody] Pa p)
        {
            if (p.ItemId == null)
            {
                return(HttpNotFound());
            }

            UserStory us = await _context.UserStories.SingleAsync(m => m.ID == p.ItemId);

            if (us == null)
            {
                return(HttpNotFound());
            }

            us.StatusCode = p.TargetStatus;
            await _context.SaveChangesAsync();

            return(Json(true));
            //return View();
        }
예제 #7
0
 private static void Reg_Int_Pa(int id, Pa pa)
 {
     cs.TryAdd(id, pa);
 }
예제 #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Pa.DataSource = Pais();
     Pa.DataBind();
 }
예제 #9
0
 private void Pa_SelectedIndexChanged(object sender, EventArgs e)
 {
     Pa.Text = Pa.GetItemText(Pa.SelectedItem).ToString();
 }
예제 #10
0
        private void Valider_Click(object sender, EventArgs e)
        {
            if (Mode == 1)
            {
                try
                {
                    clscnx.connecter();

                    date();

                    clscnx.msql("Insert into Client(cin,Prenom,Nom,Ville,Codepostal,Adresse,Sexe,N_permis,reduction,DateFP,Tel,Pays_origine,Pays_actuelle) values('" + CIN.Text + "','" + Prenom.Text + "','" + Nom.Text + "','" + Ville.Text + "','" + Code_postal.Text + "','" + Adresse.Text + "','" + b + "','" + N_permis.Text + "','" + Réduction.Text + "', '" + DateFP.Value.ToString("yyyy-MM-dd") + "','" + Tel.Text + "','" + Po.GetItemText(Po.SelectedItem) + "','" + Pa.GetItemText(Pa.SelectedItem) + "')", "Client");
                    Afficher();
                    afficher2();
                    menugeneral(true);
                }
                catch (Exception E)
                {
                    MessageBox.Show(E.Message);
                }
            }
            if (Mode == 2)
            {
                try
                {
                    //date();
                    clscnx.connecter();
                    clscnx.msql(" Update Client set  cin = '" + CIN.Text + "' ,Prenom = '" + Prenom.Text + "',Nom = '" + Nom.Text + "',Ville = '" + Ville.Text + "',Codepostal ='" + Code_postal.Text + "',Adresse = '" + Adresse.Text + "',Sexe = '" + b + "',N_permis =' " + N_permis.Text + "',reduction ='" + Réduction.Text + "',Tel = '" + Tel.Text + "',Pays_origine = '" + Po.GetItemText(Po.SelectedItem) + "',Pays_actuelle = '" + Pa.GetItemText(Pa.SelectedItem) + "'   where idclt =   " + Idclt.Text + "     ", "Client");
                    afficher2();
                    Afficher();
                    menugeneral(true);
                    groupBox1.Enabled = false;
                }
                catch (Exception E)
                {
                    MessageBox.Show(E.Message);
                }
            }
            if (Mode == 3)
            {
                try
                {
                    clscnx.connecter();
                    panelid.Visible = false;
                    clscnx.msql("Delete   from Client where idclt = " + Id.Text + "   ", "Client");
                    Afficher();
                    afficher2();
                    menugeneral(true);
                    groupBox1.Enabled = false;
                }
                catch (Exception E)
                {
                    MessageBox.Show(E.Message);
                }
            }



            else
            {
                textBox1.Text = null;
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="p1"></param>
        /// <param name="p2"></param>
        /// <param name="p3"></param>
        /// <param name="p4"></param>
        /// <returns></returns>
        public override int ComputeIntersect(Coordinate p1, Coordinate p2, Coordinate p3, Coordinate p4)
        {
            double a1;
            double b1;
            double c1;

            double a2;
            double b2;
            double c2;

            /*
             *  Coefficients of line eqns.
             */

            double r1;
            double r2;
            double r3;
            double r4;

            /*
             *  'Sign' values
             */

            IsProper = false;

            /*
             *  Compute a1, b1, c1, where line joining points 1 and 2
             *  is "a1 x  +  b1 y  +  c1  =  0".
             */
            a1 = p2.Y - p1.Y;
            b1 = p1.X - p2.X;
            c1 = p2.X * p1.Y - p1.X * p2.Y;

            /*
             *  Compute r3 and r4.
             */
            r3 = a1 * p3.X + b1 * p3.Y + c1;
            r4 = a1 * p4.X + b1 * p4.Y + c1;

            /*
             *  Check signs of r3 and r4.  If both point 3 and point 4 lie on
             *  same side of line 1, the line segments do not intersect.
             */
            if (r3 != 0 && r4 != 0 && IsSameSignAndNonZero(r3, r4))
            {
                return(NoIntersection);
            }

            /*
             *  Compute a2, b2, c2
             */
            a2 = p4.Y - p3.Y;
            b2 = p3.X - p4.X;
            c2 = p4.X * p3.Y - p3.X * p4.Y;

            /*
             *  Compute r1 and r2
             */
            r1 = a2 * p1.X + b2 * p1.Y + c2;
            r2 = a2 * p2.X + b2 * p2.Y + c2;

            /*
             *  Check signs of r1 and r2.  If both point 1 and point 2 lie
             *  on same side of second line segment, the line segments do
             *  not intersect.
             */
            if (r1 != 0 && r2 != 0 && IsSameSignAndNonZero(r1, r2))
            {
                return(NoIntersection);
            }

            /*
             *  Line segments intersect: compute intersection point.
             */
            double denom = a1 * b2 - a2 * b1;

            if (denom == 0)
            {
                return(ComputeCollinearIntersection(p1, p2, p3, p4));
            }

            double numX = b1 * c2 - b2 * c1;

            Pa.X = numX / denom;

            double numY = a2 * c1 - a1 * c2;

            Pa.Y = numY / denom;

            // check if this is a proper intersection BEFORE truncating values,
            // to avoid spurious equality comparisons with endpoints
            IsProper = true;
            if (Pa.Equals(p1) || Pa.Equals(p2) || Pa.Equals(p3) || Pa.Equals(p4))
            {
                IsProper = false;
            }

            // truncate computed point to precision grid
            if (PrecisionModel != null)
            {
                PrecisionModel.MakePrecise(Pa);
            }

            return(PointIntersection);
        }
예제 #12
0
        public Polyline DrawLaJinYJK(Point3d Pa, Point3d Pb, double BILI)
        {
            int    num  = 50;
            double num2 = 1.0;

            if (BILI == 5.0)
            {
                num  = 50;
                num2 = 1.0;
            }
            else if (BILI == 4.0)
            {
                num  = 40;
                num2 = 0.8;
            }
            else if (BILI == 3.333)
            {
                num  = 33;
                num2 = 0.6667;
            }
            else if (BILI == 2.5)
            {
                num  = 25;
                num2 = 0.575;
            }
            else if (BILI == 2.0)
            {
                num  = 25;
                num2 = 0.575;
            }
            if (Pa.X > Pb.X)
            {
                Point3d point3d = Pa;
                Pa = Pb;
                Pb = point3d;
            }
            else if (Pa.X == Pb.X & Pa.Y > Pb.Y)
            {
                Point3d point3d2 = Pa;
                Pa = Pb;
                Pb = point3d2;
            }
            double   num3             = Pa.GetVectorTo(Pb).AngleOnPlane(new Plane());
            Point3d  pointAR_Radian   = CAD.GetPointAR_Radian(Pa, num3 + 2.1111502632123411, 116.62 * num2);
            Point3d  pointAR_Radian2  = CAD.GetPointAR_Radian(Pa, num3 + 2.6012387171723486, 116.62 * num2);
            Point3d  pointAR_Radian3  = CAD.GetPointAR_Radian(Pa, num3 + 3.3899530061485863, 103.17 * num2);
            Point3d  pointAR_Radian4  = CAD.GetPointAR_Radian(Pa, num3 + 3.8098792241784216, 112.49 * num2);
            Point3d  pointAR_Radian5  = CAD.GetPointAR_Radian(pointAR_Radian4, num3 - 0.78539816339744828, 250.0 * num2);
            Point3d  pointAR_Radian6  = CAD.GetPointAR_Radian(Pb, num3 + 1.0304423903774522, 116.62 * num2);
            Point3d  pointAR_Radian7  = CAD.GetPointAR_Radian(Pb, num3 + 0.54035393641744445, 116.62 * num2);
            Point3d  pointAR_Radian8  = CAD.GetPointAR_Radian(Pb, num3 - 0.2483603525587931, 103.17 * num2);
            Point3d  pointAR_Radian9  = CAD.GetPointAR_Radian(Pb, num3 - 0.66828657058862873, 112.49 * num2);
            Point3d  pointAR_Radian10 = CAD.GetPointAR_Radian(pointAR_Radian9, num3 - 2.3561944901923448, 250.0 * num2);
            Polyline polyline         = new Polyline();

            polyline.SetDatabaseDefaults();
            double   num4      = Math.Tan(0.39269908169872414);
            double   num5      = Math.Tan(0.1308996938995747);
            Polyline polyline2 = polyline;
            int      num6      = 0;
            Point2d  point2d;

            point2d..ctor(pointAR_Radian5.get_Coordinate(0), pointAR_Radian5.get_Coordinate(1));
            polyline2.AddVertexAt(num6, point2d, 0.0, (double)num, (double)num);
            Polyline polyline3 = polyline;
            int      num7      = 1;

            point2d..ctor(pointAR_Radian4.get_Coordinate(0), pointAR_Radian4.get_Coordinate(1));
            polyline3.AddVertexAt(num7, point2d, -num5, (double)num, (double)num);
            Polyline polyline4 = polyline;
            int      num8      = 2;

            point2d..ctor(pointAR_Radian3.get_Coordinate(0), pointAR_Radian3.get_Coordinate(1));
            polyline4.AddVertexAt(num8, point2d, 0.0, (double)num, (double)num);
            Polyline polyline5 = polyline;
            int      num9      = 3;

            point2d..ctor(pointAR_Radian2.get_Coordinate(0), pointAR_Radian2.get_Coordinate(1));
            polyline5.AddVertexAt(num9, point2d, -num4, (double)num, (double)num);
            Polyline polyline6 = polyline;
            int      num10     = 4;

            point2d..ctor(pointAR_Radian.get_Coordinate(0), pointAR_Radian.get_Coordinate(1));
            polyline6.AddVertexAt(num10, point2d, 0.0, (double)num, (double)num);
            Polyline polyline7 = polyline;
            int      num11     = 5;

            point2d..ctor(pointAR_Radian6.get_Coordinate(0), pointAR_Radian6.get_Coordinate(1));
            polyline7.AddVertexAt(num11, point2d, -num4, (double)num, (double)num);
            Polyline polyline8 = polyline;
            int      num12     = 6;

            point2d..ctor(pointAR_Radian7.get_Coordinate(0), pointAR_Radian7.get_Coordinate(1));
            polyline8.AddVertexAt(num12, point2d, 0.0, (double)num, (double)num);
            Polyline polyline9 = polyline;
            int      num13     = 7;

            point2d..ctor(pointAR_Radian8.get_Coordinate(0), pointAR_Radian8.get_Coordinate(1));
            polyline9.AddVertexAt(num13, point2d, -num5, (double)num, (double)num);
            Polyline polyline10 = polyline;
            int      num14      = 8;

            point2d..ctor(pointAR_Radian9.get_Coordinate(0), pointAR_Radian9.get_Coordinate(1));
            polyline10.AddVertexAt(num14, point2d, 0.0, (double)num, (double)num);
            Polyline polyline11 = polyline;
            int      num15      = 9;

            point2d..ctor(pointAR_Radian10.get_Coordinate(0), pointAR_Radian10.get_Coordinate(1));
            polyline11.AddVertexAt(num15, point2d, 0.0, (double)num, (double)num);
            CAD.CreateLayer("柱箍筋", 1, "continuous", -1, false, true);
            polyline.Layer = "柱箍筋";
            CAD.AddEnt(polyline);
            return(polyline);
        }