Home>Article>Backend Development> PHP realizes the solution of binary linear equations

PHP realizes the solution of binary linear equations

藏色散人
藏色散人 Original
2019-04-02 15:01:02 4200browse

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.737

Related 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn