Home>Article>Backend Development> PHP realizes the solution of binary linear equations
An integral equation that contains two unknowns and the degree of the terms containing the unknowns is 1 is called a linear equation of two variables. All linear equations of two variables can be transformed into the general formula of ax by c=0 (a, b≠0) and the standard formula of ax by=c (a, b≠0), otherwise they are not linear equations of two variables.
Below we will introduce to you how to use PHP to solve linear equations of two variables with specific examples.
The linear equation of two variables is as follows:
ax + by = c dx + ey = f
Here we need to first give the values of a, b, c, d, e and f, and then print out the values of x, y .
Input: a b c d e f separated by a space. (- 1000≤a,b,c,d,e,f≤1000)
PHP code is as follows:
Output:
x和y的值分别是: -1.684 2.737Related recommendations: "PHP Tutorial"
This article is an introduction to the method of solving binary linear equations in PHP. I hope it will be helpful to friends in need!
The above is the detailed content of PHP realizes the solution of binary linear equations. For more information, please follow other related articles on the PHP Chinese website!