2个方程2未知计算器 [英] 2 equations 2 unknown Calculator
问题描述
我正在尝试创建一个Windows应用程序,我可以写入方程式,在2个文本框中,使用2个未知,x和y,然后按一个按钮,将x和y写在标签或其他内容中。 />
我已经尝试自己制作,过去2天我已经使用了大约10个小时所以现在我只需要求帮助。
该应用程序应该计算x和y由这个formel(在丹麦语上称为determinant-metoden,我将其翻译为determinant-method,但我还没有发现任何关于如何在englsih上说的话):
D = a1 * b2-a2 * b1(如果D == 0那么它不应该继续以下因为那时没有答案或者有无限的召唤者)
Dx = c1 * b2-c2 * b1
Dy = a1 * c2-a2 * c1
x = Dx / D
y = Dy / D
只要问你是否有任何问题。 =)
I am trying to make a windows app where i can write to equations, in 2 textboxes, with 2 unknown, x and y, and then press a button and get the x and y written in a label or something.
I have tried to make it myself and i have used about 10 hours the last 2 days so now i have to just ask for help.
The app hould calculate x and y by this formel(on danish it is called "determinant-metoden" and i would translate it to be "determinant-method", but i haven''t found anything about how to say it on englsih):
D= a1*b2-a2*b1 (if D == 0 then it should not continue with the following because then there is no answer or there is infinite anwsers)
Dx = c1*b2-c2*b1
Dy = a1*c2-a2*c1
x = Dx/D
y = Dy/D
Just ask if you have any questions. =)
推荐答案
那么你遇到了什么问题?
So what problem are you experiencing exactly?
我不知道如何定义一个, b和c在用户书面文字中..我试图使用Split但是每次都必须以某种方式编写方程式,我不能用它来做任何事情.. = s
但我知道a必须是x之前的数字,而b之前的数字必须是x。必须是y之前的数字。和c是=之前或之后的数字。
I don''t know how i can define a, b and c in a user written text.. I tried to use Split but then the equation have to be written in a certain way each time and i can''t use that to anythins.. =s
But i know that "a" have to be the number before "x", and "b" have to be the number before "y" and "c" is the number before or after "=".
您需要创建用户输入,如文本框或数字向上控制,然后将此值保存到变量并执行等式使用该变量:
You need to create user inputs like text boxes or numeric up down controls, you then save this value to a variable and perform the equation using that variable:
这篇关于2个方程2未知计算器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!