private void button1_Click(object sender, EventArgs e) { double Y, B, Z, W, G, M, P1, P2, P3; string y, b, z, w, g; y = textBox1.Text; z = textBox3.Text; g = textBox5.Text; Y = System.Convert.ToDouble(y); Z = System.Convert.ToDouble(z); G = System.Convert.ToDouble(g); M = 4080 * Math.Exp(0.28 * (Y - 1960)); P1 = 0.048 * Math.Pow(0.72, (Y - 1974)); P3 = (M / (Z * 30)) * G + (P1 * M); label4.Text = M.ToString(); label5.Text = P1.ToString(); label6.Text = P3.ToString(); }
public void AddToInventory(Item newItem, GameObject obj) { if (inventory.CurrentInventory.Contains(newItem)) { return; } if (inventory.CurrentInventory.Count >= inventory.InventoryCap) { return; } inventory.CurrentInventory.Add(newItem); switch (GetComponent <Transform>().tag) { case "P1": objectList.Add(newItem.ItemType.ToString() + P1.GetNumberItems(newItem.ItemType), obj); break; case "P2": objectList1.Add(newItem.ItemType.ToString() + P2.GetNumberItems(newItem.ItemType), obj); break; case "P3": objectList2.Add(newItem.ItemType.ToString() + P3.GetNumberItems(newItem.ItemType), obj); break; case "P4": objectList3.Add(newItem.ItemType.ToString() + P4.GetNumberItems(newItem.ItemType), obj); break; default: break; } }
public void activation() { QnsCall(); ReadEntries(); LogGameItems(); //Player two's turn if (x1 == false) { O1.GetComponent <CanvasGroup> ().blocksRaycasts = true; O1.SetActive(false); O2.GetComponent <CanvasGroup> ().blocksRaycasts = true; O2.SetActive(false); O3.GetComponent <CanvasGroup> ().blocksRaycasts = true; O3.SetActive(false); O4.GetComponent <CanvasGroup> ().blocksRaycasts = true; O4.SetActive(false); T1.SetActive(false); HideOptBox1(); P1.SetActive(true); P2.SetActive(true); P3.SetActive(true); P4.SetActive(true); T2.SetActive(true); ShowOptBox2(); tr2.resetClock2(); optionTxt2(); x1 = true; } //Player one's turn else { P1.GetComponent <CanvasGroup> ().blocksRaycasts = true; P1.SetActive(false); P2.GetComponent <CanvasGroup> ().blocksRaycasts = true; P2.SetActive(false); P3.GetComponent <CanvasGroup> ().blocksRaycasts = true; P3.SetActive(false); P4.GetComponent <CanvasGroup> ().blocksRaycasts = true; P4.SetActive(false); T2.SetActive(false); HideOptBox2(); O1.SetActive(true); O2.SetActive(true); O3.SetActive(true); O4.SetActive(true); T1.SetActive(true); ShowOptBox1(); tr1.resetClock1(); optionTxt1(); x1 = false; } }
/// <summary> /// Return a text representation of this object. /// </summary> public override String ToString() { return(String.Format("Triangle: Pixel1={0}, Pixel2={1}, Pixel3={2}, Value={3}", P1.ToString(), P2.ToString(), P3.ToString(), Value.ToString())); }
public f3([email protected] type, P3 owner) : base(type, "c", owner) { if (!((AbstractStoragePool)(de.ust.skill.common.csharp.api.FieldType)type).Name.Equals("c")) { throw new SkillException("Expected field type c in C.c but found " + type); } // TODO insert known restrictions? }
public void Test_03_Addition() { PrimeFieldCurve C = new NistP256(); byte[] k1, k2, k3; PointOnCurve P1, P2, P3; string s1, s2, s3; int i; for (i = 0; i < 100; i++) { k1 = C.GenerateSecret(); P1 = C.ScalarMultiplication(k1, C.PublicKeyPoint, true); s1 = P1.ToString(); do { k2 = C.GenerateSecret(); P2 = C.ScalarMultiplication(k2, C.PublicKeyPoint, true); s2 = P2.ToString(); }while (k2 == k1); Assert.AreNotEqual(P2, P1); Assert.AreNotEqual(s2, s1); do { k3 = C.GenerateSecret(); P3 = C.ScalarMultiplication(k3, C.PublicKeyPoint, true); s3 = P3.ToString(); }while (k3 == k1 || k3 == k2); Assert.AreNotEqual(P3, P1); Assert.AreNotEqual(s3, s1); Assert.AreNotEqual(P3, P2); Assert.AreNotEqual(s3, s2); PointOnCurve S1 = P1; C.AddTo(ref S1, P2); C.AddTo(ref S1, P3); PointOnCurve S2 = P2; C.AddTo(ref S2, P3); C.AddTo(ref S2, P1); PointOnCurve S3 = P3; C.AddTo(ref S3, P1); C.AddTo(ref S3, P2); Assert.AreEqual(S1, S2); Assert.AreEqual(S2, S3); Assert.AreEqual(s1, P1.ToString()); Assert.AreEqual(s2, P2.ToString()); Assert.AreEqual(s3, P3.ToString()); } }
public f5([email protected] type, P3 owner) : base(type, "☢", owner) { if (type.TypeID != 14) { throw new SkillException("Expected field type string in ∀.☢ but found " + type); } // TODO insert known restrictions? }
// Use this for initialization void Start() { player = GameObject.Find("P3").GetComponent <P3>(); // points3 = 0; puf = GameObject.Find("Puf"); module = Vector3.Magnitude(player.bulletDirection); inputDirection = player.bulletDirection / module; }
public override void rsc(int i, int h, MappedInStream @in) { subtypes.A[] d = ((P0)owner.basePool).Data; P3 t = ((P3)(object)this.type); for (; i != h; i++) { ((subtypes.C)d[i]).c = (subtypes.C)t.getByID(@in.v32()); } }
public override void rsc(int i, int h, MappedInStream @in) { escaping.Z2200[] d = ((P3)owner).Data; P3 t = ((P3)(object)this.type); for (; i != h; i++) { d[i].Z20ac = (escaping.Z2200)t.getByID(@in.v32()); } }
public override bool Equals(object obj) { var other = obj as Triangle; return(base.Equals(other) || ((other != null) && P1.Equals(other.P1) && P2.Equals(other.P2) && P3.Equals(other.P3))); }
private void btnhome_Click(object sender, EventArgs e) { P1.Hide(); P2.Hide(); P3.Hide(); P4.Hide(); P5.Show(); P5.BringToFront(); lbltab.Text = "Home Page"; btnConnecting.BackColor = Color.FromArgb(41, 39, 40); btnConnecting.ForeColor = Color.DimGray; btnsetting.BackColor = Color.FromArgb(41, 39, 40); btnsetting.ForeColor = Color.DimGray; btncontroller.BackColor = Color.FromArgb(41, 39, 40); btncontroller.ForeColor = Color.DimGray; btnstatus.BackColor = Color.FromArgb(41, 39, 40); btnstatus.ForeColor = Color.DimGray; btnhome.BackColor = Color.FromArgb(41, 39, 70); btnhome.ForeColor = Color.Aquamarine; }
private void btnstatus_Click(object sender, EventArgs e) { P1.Hide(); P2.Hide(); P3.Hide(); P5.Hide(); P4.Show(); P4.BringToFront(); lbltab.Text = "Status Page"; btnConnecting.BackColor = Color.FromArgb(41, 39, 40); btnsetting.BackColor = Color.FromArgb(41, 39, 40); btncontroller.BackColor = Color.FromArgb(41, 39, 40); btnstatus.BackColor = Color.FromArgb(41, 39, 70); btnhome.BackColor = Color.FromArgb(41, 39, 40); }
/// <inheritdoc/> public override int GetHashCode() { unchecked { int result = P1.GetHashCode(); result = (result * 397) ^ P2.GetHashCode(); result = (result * 397) ^ P3.GetHashCode(); result = (result * 397) ^ P4.GetHashCode(); return(result); } }
public ICurve Convert() { if (P3.LengthSquared() > 0) { return(new CubicCurve(P0, P1, P2, P3)); } if (P2.LengthSquared() > 0) { return(new QuadraticCurve(P0, P1, P2)); } return(new LinearCurve(P0, P1)); }
private void btnHistory_Click(object sender, EventArgs e) { P1.Hide(); P2.Hide(); P3.Hide(); P4.Hide(); P5.Hide(); P7.Show(); P7.BringToFront(); lbltab.Text = "Report Page"; btnConnecting.BackColor = Color.FromArgb(41, 39, 40); btnConnecting.ForeColor = Color.DimGray; btnSetting.BackColor = Color.FromArgb(41, 39, 40); btnSetting.ForeColor = Color.DimGray; btnController.BackColor = Color.FromArgb(41, 39, 40); btnController.ForeColor = Color.DimGray; btnStatus.BackColor = Color.FromArgb(41, 39, 40); btnStatus.ForeColor = Color.DimGray; btnHome.BackColor = Color.FromArgb(41, 39, 40); btnHome.ForeColor = Color.DimGray; btnHistory.BackColor = Color.FromArgb(41, 39, 70); btnHistory.ForeColor = Color.Aquamarine; }
/// <summary> /// 输出标准STL(ASCII)格式 /// </summary> /// <returns></returns> public override string ToString() { string normalLine = "facet normal " + Normal.ToString() + "\n"; string outLoopLine = "outer loop" + "\n"; string p1Line = "vertex " + P1.ToXYZString() + "\n"; string p2Line = "vertex " + P2.ToXYZString() + "\n"; string p3Line = "vertex " + P3.ToXYZString() + "\n"; string endLoopLine = "endloop" + "\n"; string endFacet = "endfacet" + "\n"; return(normalLine + outLoopLine + p1Line + p2Line + p3Line + endLoopLine + endFacet); }
public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hash = 17; // Suitable nullity checks etc, of course :) hash = hash * 23 + P1.GetHashCode(); hash = hash * 23 + P2.GetHashCode(); hash = hash * 23 + P3.GetHashCode(); hash = hash * 23 + P4.GetHashCode(); return(hash); } }
public static IChannel CreateChannel(string channelName) { IChannel channel = null; switch (channelName) { case "RixFM": channel = new RixFM(); break; case "P3": channel = new P3(); break; } return channel; }
public override int GetHashCode() { unchecked { var result = _f1; result = (result * 397) ^ (F2 != null ? F2.GetHashCode() : 0); result = (result * 397) ^ (P0 != null ? P0.GetHashCode() : 0); result = (result * 397) ^ (P2 != null ? P2.GetHashCode() : 0); result = (result * 397) ^ (P3 != null ? P3.GetHashCode() : 0); result = (result * 397) ^ (P4 != null ? P4.GetHashCode() : 0); result = (result * 397) ^ (P5 != null ? P5.GetHashCode() : 0); return(result); } }
void OnCollisionStay(Collision collisionInfo) { if (collisionInfo.gameObject.tag == "Player") { //turns on correct path. didn't know a better way to go about this P1.SetActive(true); P2.SetActive(true); P3.SetActive(true); P4.SetActive(true); P5.SetActive(true); P6.SetActive(true); P7.SetActive(true); } }
static void Main(string[] args) { // Wrong Usage! // Person P; // P.Age = 20; // P.FullName = "Ali Reza Alavi"; // P.ShowInfo(); Person P1; P1 = new Person(); P1.Age = 20; P1.FullName = "Ali Reza Alavi"; P1.ShowInfo(); System.Console.WriteLine("\n"); Person P2 = new Person(); P2.Age = 30; P2.FullName = "Sara Ahmadi"; P2.ShowInfo(); System.Console.WriteLine("\n"); Person P3; P3 = P1; P3.ShowInfo(); System.Console.WriteLine("\n"); Person P4 = P2; P4.ShowInfo(); System.Console.WriteLine("\n"); Person P5 = P1; P5.Age = 21; P5.ShowInfo(); P1.ShowInfo(); System.Console.ReadLine(); }
public override bool Equals(object obj) { return(obj is Triangle triangle && Transform.Equals(triangle.Transform) && Material.Equals(triangle.Material) && Parent == triangle.Parent && HasParent == triangle.HasParent && P1.Equals(triangle.P1) && P2.Equals(triangle.P2) && P3.Equals(triangle.P3) && Edge1.Equals(triangle.Edge1) && Edge2.Equals(triangle.Edge2) && Normal.Equals(triangle.Normal) && N1.Equals(triangle.N1) && N2.Equals(triangle.N2) && N3.Equals(triangle.N3) && IsSmoothed == triangle.IsSmoothed); }
public override int GetHashCode() { var hashCode = 2018318558; hashCode = hashCode * -1521134295 + T1.GetHashCode(); hashCode = hashCode * -1521134295 + T2.GetHashCode(); hashCode = hashCode * -1521134295 + T3.GetHashCode(); hashCode = hashCode * -1521134295 + T4.GetHashCode(); hashCode = hashCode * -1521134295 + T5.GetHashCode(); hashCode = hashCode * -1521134295 + P1.GetHashCode(); hashCode = hashCode * -1521134295 + P2.GetHashCode(); hashCode = hashCode * -1521134295 + P3.GetHashCode(); hashCode = hashCode * -1521134295 + P4.GetHashCode(); hashCode = hashCode * -1521134295 + P5.GetHashCode(); hashCode = hashCode * -1521134295 + JunctionIndex.GetHashCode(); hashCode = hashCode * -1521134295 + NearestJunctionIndex.GetHashCode(); return(hashCode); }
/// <summary> /// Interpolate a Bezier segment with a given precision /// </summary> /// <param name="i">Index first point of Bezier segment</param> /// <param name="precision">precision</param> /// <param name="points">List of points where to add new points for the segment</param> private void InterpolateSegment(int i, double precision, List <PointD> points) { PointD P0, P1, P2, P3; double maxMedianLengthSqr = Math.Max( ControlPoints[i + 1].Median(ControlPoints[i], ControlPoints[i + 2]).LengthSqr(), ControlPoints[i + 2].Median(ControlPoints[i + 1], ControlPoints[i + 3]).LengthSqr() ); if (maxMedianLengthSqr <= 0.25 * precision * precision) { points.Add(ControlPoints[i + 3]); return; } double cnt = Math.Min((int)Math.Sqrt(Math.Sqrt(maxMedianLengthSqr) / precision) + 3, 1500); double d = 1 / cnt; P0 = ControlPoints[i]; P1 = DeCasteljau(i, d); points.Add(P1); P2 = DeCasteljau(i, 2 * d); points.Add(P2); P3 = DeCasteljau(i, 3 * d); points.Add(P3); P0 = P1.Substract(P0); P1 = P2.Substract(P1); P2 = P3.Substract(P2); // P0 = P1.Substract(P0); P1 = P2.Substract(P1); // P0 = P1.Substract(P0); for (int j = 4; j <= (int)cnt; j++) { P1 = P1.Addition(P0); P2 = P2.Addition(P1); P3 = P3.Addition(P2); points.Add(P3); } }
public override int GetHashCode() { var hashCode = -1044093539; hashCode = hashCode * -1521134295 + T1.GetHashCode(); hashCode = hashCode * -1521134295 + T2.GetHashCode(); hashCode = hashCode * -1521134295 + T3.GetHashCode(); hashCode = hashCode * -1521134295 + T4.GetHashCode(); hashCode = hashCode * -1521134295 + T5.GetHashCode(); hashCode = hashCode * -1521134295 + P1.GetHashCode(); hashCode = hashCode * -1521134295 + P2.GetHashCode(); hashCode = hashCode * -1521134295 + P3.GetHashCode(); hashCode = hashCode * -1521134295 + P4.GetHashCode(); hashCode = hashCode * -1521134295 + P5.GetHashCode(); hashCode = hashCode * -1521134295 + JunctionIndex.GetHashCode(); hashCode = hashCode * -1521134295 + NearestJunctionIndex.GetHashCode(); hashCode = hashCode * -1521134295 + Length.GetHashCode(); hashCode = hashCode * -1521134295 + Lock.GetHashCode(); return(hashCode); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MoveMouse(object sender, EventArgs e) { //Valeurs du positionnement de la souris int iX = PointToClient(MousePosition).X; int iY = PointToClient(MousePosition).Y; int iDiff = 15; //Taille des lignes graphiques //Création des chemins (lignes) graphiques P.AddLine(iLastX - iDiff, iLastY - iDiff, iX + iDiff, iY + iDiff); P1.AddLine(iLastX + iDiff, iLastY + iDiff, iX - iDiff, iY - iDiff); P2.AddLine(iLastX - iDiff, iLastY - iDiff, iX - iDiff, iY - iDiff); P3.AddLine(iLastX + iDiff, iLastY + iDiff, iX + iDiff, iY + iDiff); //Dernières valeurs du positionnement de la souris iLastX = iX; iLastY = iY; Invalidate(); //Mise à jour des chemins graphiques }
public override ArrayList GetItemInfo() { ArrayList itemInfo = new ArrayList { new InputText(this, "P1:", P1.ToString(), true, "p1"), new InputText(this, "U1:", U1.ToString(), true, "u1"), new InputText(this, "V1:", V1.ToString(), true, "v1"), new InputText(this, "P2:", P2.ToString(), true, "p2"), new InputText(this, "U2:", U2.ToString(), true, "u2"), new InputText(this, "V2:", V2.ToString(), true, "v2"), new InputText(this, "P3:", P3.ToString(), true, "p3"), new InputText(this, "U3:", U3.ToString(), true, "u3"), new InputText(this, "V3:", V3.ToString(), true, "v3"), new InputText(this, "Material:", Enum.GetName(typeof(P3DMaterial), Material), false, ""), }; return(itemInfo); }
public override int GetHashCode() { int hashCode = -2063967696; hashCode = hashCode * -1521134295 + Transform.GetHashCode(); hashCode = hashCode * -1521134295 + Material.GetHashCode(); hashCode = hashCode * -1521134295 + SavedRay.GetHashCode(); hashCode = hashCode * -1521134295 + Parent.GetHashCode(); hashCode = hashCode * -1521134295 + HasParent.GetHashCode(); hashCode = hashCode * -1521134295 + P1.GetHashCode(); hashCode = hashCode * -1521134295 + P2.GetHashCode(); hashCode = hashCode * -1521134295 + P3.GetHashCode(); hashCode = hashCode * -1521134295 + Edge1.GetHashCode(); hashCode = hashCode * -1521134295 + Edge2.GetHashCode(); hashCode = hashCode * -1521134295 + Normal.GetHashCode(); hashCode = hashCode * -1521134295 + N1.GetHashCode(); hashCode = hashCode * -1521134295 + N2.GetHashCode(); hashCode = hashCode * -1521134295 + N3.GetHashCode(); hashCode = hashCode * -1521134295 + IsSmoothed.GetHashCode(); return(hashCode); }
public int CompareTo(object obj) { IP comp = (IP)obj; int result = P1.CompareTo(comp.P1); if (result != 0) { return(result); } result = P2.CompareTo(comp.P2); if (result != 0) { return(result); } result = P3.CompareTo(comp.P3); if (result != 0) { return(result); } result = P4.CompareTo(comp.P4); return(result); }
/// <summary> /// allocate correct pool type and add it to types /// </summary> internal static AbstractStoragePool newPool(string name, AbstractStoragePool superPool, List <AbstractStoragePool> types) { try { switch (name) { case "testenum": return(superPool = new P0(types.Count)); case "testenum:default": return(superPool = new P1(types.Count, (P0)superPool)); case "testenum:second": return(superPool = new P2(types.Count, (P0)superPool)); case "testenum:third": return(superPool = new P3(types.Count, (P0)superPool)); case "testenum:last": return(superPool = new P4(types.Count, (P0)superPool)); default: if (null == superPool) { return(superPool = new BasePool <SkillObject>(types.Count, name, AbstractStoragePool.noKnownFields, AbstractStoragePool.NoAutoFields)); } else { return(superPool = superPool.makeSubPool(types.Count, name)); } } } finally { types.Add(superPool); } }