Math Program Ideas

Post your ideas for new math programs here, or build on ideas posted by other visitors.


Reply to this item

linear,quadratic,cubic,quintic

miscellaneousprogrammer

does anybody know of a program which solves linear, quadratic, cubic, and biquadratic equations? Really what I am looking for is the solution to the cubic/biquadratic equations, though it would be fine if the other 2 were included. Thanks


23 December 2003, 17:27 GMT














Re: Re: Re: Re: linear,quadratic,cubic,quartic

jrock7286

This program will give only the real roots of the cubic equation...I'm still working on the complex part
(> is the sto key)
BEGINNING OF PROGRAM
Disp "Ax^3+Bx^2+Cx+D=0"
Prompt A,B,C,D
(2(B/A)^39BC/A^2+27D/A)/27 > W
(3C/A(B/A)^2)/3 > V
W^2/4+V^3/27 > Y
If Y>0
Then
.5W+sqrt(Y) > E
.5Wsqrt(Y) > F
sqrt(abs(E)) > S
If E<0
S > S
sqrt(abs(F)) > T
If F<0
Then
T > T
End
Disp "x=",S+TB/(3A)
End
If Y<0
Then
W/2*sqrt(27/abs(v^3)) > Z
Pi/2 > theta
If Z != 0 (doesn't equal)
arctan(sqrt(1Z^2)/Z) > theta
If theta < 0
theta+Pi > theta
Disp "x=", 2 sqrt(abs(V)/3)*cos(theta/3)  B/(3A), 2 sqrt(abs(V)/3)*cos((2Pi+theta)/3)  B/(3A), 2 sqrt(abs(V)/3)*cos((4Pi+theta)/3)  B/(3A)
End
If Y=0
Then
sqrt(abs(W)/2) > S
If W>0
S > S
Disp "x=",2SB/(3A),SB/(3A)
End
END OF PROGRAM
This should be right, if it isn't, either let me know in a reply to this, or email me at jrock7286@aol.com. Hope this was of help to you!


1 January 2004, 21:40 GMT

















Simplify people!

shkaboinka
(Web Page)

Here, let me simplify that (not that [^1], [^2], and [^3] can all be replaced by single tokens):
SET THE MODE TO RADIANS OR DEGREES (I dont know which)
Disp "Ax^3+Bx^2+Cx+D=0
Prompt A,B,C,D
27[^1](2(B/A)[^3]9BC/A[^2]+27D/A > W
3[^1](3C/A(B/A)^2 > V
W[^2]/4+V[^3]/27 > Y
If Y>0
Then
.5W+sqrt(Y > E
.5Wsqrt(Y > F
(12(E<0))sqrt(abs(E > S
(12(E<0))sqrt(abs(F > T
Disp "x=",S+TB/(3A
End
If Y<0
Then
.5(W sqrt(27/abs(v[^3] > Z
Pi/2 > theta
If Z
arctan(sqrt(1Z[^2])/Z > theta
theta+Pi(theta<0 > theta
Disp "x=", 2 sqrt(abs(V)/3)*cos(theta/3)  B/(3A), 2 sqrt(abs(V)/3)*cos((2Pi+theta)/3)  B/(3A), 2 sqrt(abs(V)/3)*cos((4Pi+theta)/3)  B/(3A)
End
If not(Y
Then
(12(W<0))sqrt(abs(W)/2 > S
Disp "x=",2SB/(3A),SB/(3A
End


3 February 2004, 17:56 GMT




















Re: Re: Re: Re: Re: Re: linear,quadratic,cubic,quartic

chandragupta

I have another way to do it... it is about as long, but it gives all three roots. even the complex ones (in the a+bi form, witch is a little hard to interpret if they are decimal parts)
the way i did it was to get the general cubic equation, then, (because this ony gives one root) i do synthetic division and get the supressed (quadratic) equation and use a quadratic solver (another program i made, and simple to make). this may seem long, but it does work, including the imaginary parts.
If you want the general cubig formula, here it is:
x={q + [q2 + (rp2)3]1/2}1/3 + {q  [q2 + (rp2)3]1/2}1/3 + p
where
p = b/(3a), q = p3 + (bc3ad)/(6a2), r = c/(3a)
Happy Programming.


6 December 2005, 02:56 GMT





Re: linear,quadratic,cubic,quintic

Robotbeat

I created a function called "Quartic Solver" (and I uploaded it, waiting for it to be added...) which solves the quartic exactly. I used Mathematica, which is IMO better than Maple. Anyways, it's for the TI89 because that's what I have. It's of course a BASIC program. It solves for all four roots, real or complex. The answers are arranged in a matrix. The function is pretty big, weighing in at 5KB or so, but there's nothing you can do about it if you want it to be precise. I didn't bother uploading my other cubic solver because I already saw a BASIC TI89 cubic solver. You can't have the first term (i.e. 0*x^4) be zero because you get an "undef" so you'll have to use a different program for solving the cubic. If I get around to it, maybe I'll upload the cubic solver as well.
A word of warning, to solve a quartic equation takes like a minute. Cubics are much better, usually around 10 seconds.


7 April 2004, 19:56 GMT





Re: linear,quadratic,cubic,quintic

Wesley Transue

If you have a TI83, or any version of it, press [math], then [0] and it will come up with the equation solver. Just type in the equation (like ax+b, ax^2+bx+c, ax^3+bx^2+cx+d=0, etc.), press enter, and tell it what the variables equal. To solve for 'x', clear the x variable (after all other variables are given values) and press [alpha], then [enter]. Of course this takes out all the fun of programming, but I think we can live without it. It can do many other equations, you just have to type them in.


24 June 2004, 14:33 GMT




















Pessimistic, much?

nemo123

Don't be such a downer.
here's how you would solve a proof using ASM (perhaps it could be implemented with BASIC/ASM libraries, though i doubt it.):
create an interface similar to CabriJr.s or GeoMastr. Allow the user to draw lines, perpindicular bisectors, congruency indicators, etc.
When the user is finished, find out everything you can about the photo. Find as many unknown angles and side lengths as numerically possible. This could be done using Constant variables. for example, if you have a right angle cut in two parts by a ray and you know one of the angle's made by the ray, you can find the other part of the right angle. indicating you used the knowledge of complementary angles could be as simple as incrementing a count, and outputting that string to the user.
For each step you take, output what you did. of course, you would need a vast library of theorems to pull from, and you would need large amounts of memory to figure what situation fits the theorem in question.
"When someone tells you it's impossible, take it as "According to my limited knowledge and small scope of the universe, i dictate that as very unlikely"".


31 March 2010, 23:01 GMT


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
You can change the number of comments per page in Account Preferences.
