2 Equations 2 Unknows - How to program in C#?
-
Hi All: I have the following algebraic equations I want to code in C#. I am not sure how to do this. Please help! 495 = 66t + c 951 = 190 + c How do I write this in code? Thanks, Laura
-
Sorry the equations are actually: 495 = 66t + c 951 = 190t + c Thanks! Please Help! :laugh: Laura
Are you looking for an algorithm for solving two simultaneous equations[^]? And you want to code that in C#? Make sure you understand the algorithm first without being concerned about how to implement it in C#. Once you have a strong handle on the algorithm, you can then begin to consider how to implement it in C#. The above link describes three approaches.
-
Hi All: I have the following algebraic equations I want to code in C#. I am not sure how to do this. Please help! 495 = 66t + c 951 = 190 + c How do I write this in code? Thanks, Laura
-
You must use the matrix. for ex: 2x+6y=8 3x+2y=5
|8 6|
|5 2| -14
x=-----= --- = 1
|2 6| -14
|3 2||2 8|
|3 5| -14
y=-----= --- = 1
|2 6| -14
|3 2|sol x=1 y=1.
this method works for n Equations n Unknows. FOR 2 Equations 2 Unknows For one system like this: {a*X+b*Y=c {d*X+e*Y=f the part of code ar: if (a*e-d*b) { X=(c*e-f*b)/(a*e-d*b); Y=(a*f-d*c)/(a*e-d*b); } else { MessageBox.Show("Many solution!!!"); } PS: The determinant |a b| is equal with a*d-b*c |c d| math my love