Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

# Thread: How do i make two equations have to be equal?

1. ## How do i make two equations have to be equal?

Right now i am writing a program that will find the intersection point of two lines. My general equations are y=m1 * x + b1 and y = m2 * x +b2. I want to make m1 * x + b1 HAVE to equal m2 * x + b2, but i have no idea how to. Anyone have any suggestions?

2. ## Re: How do i make two equations have to be equal?

What are you stuck on, figuring out the mathematics of making equations equal or writing code to demonstrate the solution?

3. ## Re: How do i make two equations have to be equal?

Originally Posted by jamesR
... Anyone have any suggestions?...
My suggestion is to use algebra to derive arithmetic expressions for x and y in terms of m1, b1, m2, and b2.

Then write a program that gets user input for values of m1, b1, m2, and b2 and then evaluates the expressions to calculate (and, presumably, print) values of x and y.

Cheers!

Z