[QUOTE=Robert64;22063517]Also the Newton-Raphson method can sometimes head away from a solution in unlucky circumstances.[/QUOTE]
So, that would mean by method is a bit more reliable?
[QUOTE=Overv;22065130]So, that would mean by method is a bit more reliable?[/QUOTE]
Yup, I would stick with it for now.
Does it handle multiple solutions ie. parabolas?
HLLib for Mac: [url]http://helium.hexxeh.net/HLLib.zip[/url]
To use, navigate into HLLib folder you extracted then do the following:
cd HLLib
make
cd ../HLExtract
make
Only required a few small changes, but a few people over the Steam Forums asked for the code so I thought I may as well post it over here too. You'll need Xcode installed to compile, of course.
Slow day today eh?
[QUOTE=TheBoff;22063665]Sorry, but it's actually bloody difficult to do, and there are many cases where it can't be done at all.
For instance
(x^2)y = 2x(y^2) - 5
You cannot actually solve it for y, unless I've written the problem down wrong, and to find the derivative you need to use implicit differentiation, and the chain and product rules. It's not trivial.[/QUOTE]
You can by the way solve that for y
-2x*y^2 + (x^2)*y + 5 = 0
y = (-(x^2) +- sqrt((x^2)^2 - 4*(-2x)*5))/(2*-2x)
y = (x^2 +- sqrt(x^4 + 40x))/(4x)
[QUOTE=Overv;22062711]Is [url=http://82.171.96.250/dev/solver.php][b][u]this[/u][/b][/url] the way I should be going with equation solving?[/QUOTE]
no.
I'm working on this website: [url]www.picdash.com[/url]
[QUOTE=TheBoff;22063665]
(x^2)y = 2x(y^2) - 5
[/QUOTE]
Random, but that actually looks kind of cool:
[img]http://img8.imageshack.us/img8/6477/forummath.png[/img]
[QUOTE=adamjon858;22078463]I'm working on this website: [url]www.picdash.com[/url][/QUOTE]
I went through about 51 pictures, "liked" only about 3 of them.
The fuck? You can't go from SByte to int?
Have to fucking do "(int)(byte)(SByte)SByteObj".
Edit:
Completely forgot that would make end up making negative numbers positive. Just thought of a work around from the msdn page.
(int)((SByte)SByteObj + 0)
I'm writing a python script to interact with MyBB style shoutboxes. Like a chat client.
I'm able to get data from the shoutbox :D
[img]http://img192.imageshack.us/img192/1937/20100521894x818.png[/img]
Not I need to format everything and allow the user to post in the shoutbox.
[editline]12:49PM[/editline]
Ohh and come up with some kind of an interface...
And add support for multiple config files
Better start making a TODO list...
Went back to work on my AS3 interpreted language, added a hacked array type thing.
[code]Hook Main()
Local test_array = Array.New( "hello", "there", 57 * 1.4, 23, Array.New( "2D", "Arrays!" ), 54 )
test_array = Array.Push( test_array, "hai" )
test_array = Array.Unshift( test_array, "gsdfsdf" )
Local i = 0
Local len = Array.Length( test_array )
Print( len )
While i < 5
Print( Array.GetItem( test_array, i ))
i += 1
EndWhile
Print( Array.GetItem( Array.GetItem( test_array, 5 ), 0 ) + " " + Array.GetItem( Array.GetItem( test_array, 5 ), 1 ))
EndHook[/code]
Output:
[code]8
gsdfsdf
hello
there
79.8
23
2D Arrays![/code]
I know the way I add to arrays etc (Array.*) is shitty but I can't be bothered to add in real arrays with [ index ] operators etc.
[editline]05:59PM[/editline]
I did this so that I can generate dungeons for my RPG easier, like a list of rooms etc.
I've started working on the program using my expression class. I've almost finished the basic expression evaluator in C#. The next thing after this is solving implicit equations, both 1-dimensional and 2-dimensional.
[img]http://bit.ly/cB7sON[/img]
The icon on the left shows the result of the whole expression and the icon on the right the evaluation of the selected part. This helps 'debugging' a larger and more complex expression.
Currently this is the interface to add constants and functions:
[cpp]// Set constants
expression.SetConstant( "pi", 3.1415926535897932384626433 );
expression.SetConstant( "e", 2.7182818284590452353602874 );
expression.SetConstant( "phi", 1.6180339887498948482045868 );
// Add functions
expression.SetFunction( "sin", Math.Sin );
expression.SetFunction( "cos", Math.Cos );
expression.SetFunction( "tan", Math.Tan );
expression.SetFunction( "log", Math.Log10 );
expression.SetFunction( "ln", Math.Log );
expression.SetFunction( "sqrt", Math.Sqrt );[/cpp]
Functions only support one argument right now, but I don't think that's much of a problem. Anyway, this project is helping me learn C# and appreciating it more.
[QUOTE=Boris-B;22083722]Better start making a TODO list...[/QUOTE]
May I suggest [url=http://sourceforge.net/projects/todofreely/]Todo Freely[/url]? It's an amazing program to manage todo lists.
[QUOTE=Overv;22083959]May I suggest [URL="http://sourceforge.net/projects/todofreely/"]Todo Freely[/URL]? It's an amazing program to manage todo lists.[/QUOTE]
WOW, it is good.
Recommended.
[QUOTE=Overv;22083959]
May I suggest [url=http://sourceforge.net/projects/todofreely/]Todo Freely[/url]? It's an amazing program to manage todo lists.[/QUOTE]
No linux support :(
It's written in C#. I g2g now, but I might port it tomorrow to run properly under UNIX systems.
[url]http://www.rememberthemilk.com/[/url]
[QUOTE=Overv;22083959]I've started working on the program using my expression class. I've almost finished the basic expression evaluator in C#. The next thing after this is solving implicit equations, both 1-dimensional and 2-dimensional.
[IMG]http://bit.ly/cB7sON[/IMG]
The icon on the left shows the result of the whole expression and the icon on the right the evaluation of the selected part. This helps 'debugging' a larger and more complex expression.
Currently this is the interface to add constants and functions:
// Set constants
expression.SetConstant( "pi", 3.1415926535897932384626433 );
expression.SetConstant( "e", 2.7182818284590452353602874 );
expression.SetConstant( "phi", 1.6180339887498948482045868 );
// Add functions
expression.SetFunction( "sin", Math.Sin );
expression.SetFunction( "cos", Math.Cos );
expression.SetFunction( "tan", Math.Tan );
expression.SetFunction( "log", Math.Log10 );
expression.SetFunction( "ln", Math.Log );
expression.SetFunction( "sqrt", Math.Sqrt );
Functions only support one argument right now, but I don't think that's much of a problem. Anyway, this project is helping me learn C# and appreciating it more.
May I suggest [URL="http://sourceforge.net/projects/todofreely/"]Todo Freely[/URL]? It's an amazing program to manage todo lists.[/QUOTE]
Wow that is cool. I might start working on an expression parser in python. Looks like a fun project.
I made one in Lua a while ago. It supports constants and functions (with multiple arguments).
I had to write an expression parser for my interpreted language. It's a good exercise to use recursion in, and make a nice elegant solution.
Writing my own token parser is fun, I got it to recognize integers and operators. Example:
[code]
"123+123-123*123/123^123"
['123', '+', '123', '-', '123', '*', '123', '/', '123', '^', '123']
[/code]
[QUOTE=Overv;22083959]
[img]http://bit.ly/cB7sON[/img]
[/QUOTE]
Try -2^-2 and -2^--2.
[editline]03:41PM[/editline]
BTW, small tip: you can easily handle multiple function parameters with an array. For example, a piece of my code:
[cpp]
hardFuncs["abs"] = (float[] args) => { return (float)Math.Abs(args[0]); };
hardFuncs["rand"] = (float[] args) => { return (float)rand.NextDouble(); };
hardFuncs["max"] = (float[] args) => { return Math.Max(args[0], args[1]); };
[/cpp]
But how does it know how many arguments it needs, or do you have no error checking for that?
There's a second array:
[cpp]
hardFuncNumParams["abs"] = 1;
hardFuncNumParams["rand"] = 0;
hardFuncNumParams["max"] = 2;
[/cpp]
Parsers are the new Ray Tracers
[QUOTE=CarlBooth;22086561]Parsers are the new Ray Tracers[/QUOTE]
Parsers are the new equation graphers.
Parsers are the new mandelbrot renderers.
Parsers are the new projects everyone in this thread are trying.
[QUOTE=ZeekyHBomb;22084531]It's written in C#. I g2g now, but I might port it tomorrow to run properly under UNIX systems.[/QUOTE]
[url]http://anyhub.net/file/todofreelyunix.tar.bz2[/url]
Only had to adjust one line and a small helper-class :)
I'm going to contact the author of this program about it.
[QUOTE=arienh4;22087915]Parsers are the new projects everyone in this thread are trying.[/QUOTE]
Not me... :'(
Sorry, you need to Log In to post a reply to this thread.