Linear equation solution - Programmers Heaven

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

# Linear equation solution

Posts: 3Member

I am looking for an algorithm in C++
to solver linear equations

Do you have an idea whare I can find it???

thanks

• Posts: 675Member
I am not much of a C++ programmer but I am pretty good at math.

If you have 2 lines defined by the equations:
y= m*x+ b
and y= n*x+ c

the solution is:

x = (c-b)/(m-n)
y = m*x+b // if you have x calculated
// otherwise
y = m*(c-b)/(m-n)+b

I hope this helps.

:
: I am looking for an algorithm in C++
: to solver linear equations
:
: Do you have an idea whare I can find it???
:
: thanks
:

• Posts: 3Member
Thanks for your
help

bye

: I am not much of a C++ programmer but I am pretty good at math.
:
: If you have 2 lines defined by the equations:
: y= m*x+ b
: and y= n*x+ c
:
: the solution is:
:
: x = (c-b)/(m-n)
: y = m*x+b // if you have x calculated
: // otherwise
: y = m*(c-b)/(m-n)+b
:
: I hope this helps.
:
: :
: : I am looking for an algorithm in C++
: : to solver linear equations
: :
: : Do you have an idea whare I can find it???
: :
: : thanks
: :
:
: