Page 1 of 1

Math prog

Posted: Wed Nov 03, 2010 4:10 pm
by floogle11
Hey guys i hate this one problem and i wanna program a program to do the work for me and i cant think of how to start.

Problem is like this:
(x + 1)(x + 6)(x - 4)
or like:
(2x + 3)(x - 4)(3x * 4)
And i want to the numbers as variables.

Posted: Wed Feb 23, 2011 9:51 am
by esdel
How to start is think about this

When you multiply your three ( ) together you get what's called a cubic
like x^3 + Ax^2 + Bx + C

So work out A,B,C and you have your answer

If you actually mean ( )( )( ) = 0 you have a cubic equation and the formula for finding x is in Google

Posted: Sun Apr 03, 2011 7:12 pm
by Kiyotewolf
If you want it to rewrite your formula into it's other forms, then you're going to have to write a formula parser, something that can take the text of the expression you're writing, and be able to re-write it using rules of algebra.

If you want it to solve the expression for answers, you can use a FOR NEXT loop and give it ranges of integers, or decimal values, and watch for answers which are zero, or close to zero.



~Kiyote!

a = (x * x)(y * y)(z * z)
~~~ if you want to solve something like in this form, you're going to have to look for numbers that make a become zero.

It would be easier to start off visualizing the program, by just drawing points on the screen.

Feed it values going in, and plot values coming out.

If you get past 3 variables, you're going to have a a hard time visualizing it, because you'll have passed 3 dimensions.