Omnimaga

Omnimaga => News => Topic started by: excale on May 01, 2012, 06:14:45 pm

Title: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: excale on May 01, 2012, 06:14:45 pm
As you may know,TI-Nspire's Basic is really good for math stuff.
But when its comes to games and graphical programming, it is another story.

Lua can handle this, but is slow compared to compiled code, and has lots of limitations. Though, Lua had a pretty interesting advantage: you can use the native math engine trough math.eval() (and thus use CAS on CAS-nspires).

Thus, I decided to code a library which use to native Nspire's math engine in order on make advances calculus in Ndless programs. This allows to make math and physics programs, which is really harder without what you may know under the name of math.eval() or expr().

For those who know about Lua, math.eval() does returns a number. Here, it is more like expr(), and returns anything (in a string).

I didn't start the library code 'itself' (it is already very long to figure out how the math engine works...). Thus, for now, it is only usable in console-mode (for debugging ect...). By the way, thanks to Compu for his NspireIO :).

Here is a screenshot of what I've made.
(http://www.mirari.fr/8lwf)
(the strange 'a <<' is because the math engine returns an UTF-8 string and the console handles ASCII strings.)

For now, there are two major functions: one which 'corrects' the input (functions are case-sensitive, ect...) and another one which actually does the calculus. I don't think I can find a function that adds forgotten parenthesis, as they are added directly when you type the expression, and not during the evaluation.

Now it's your time to say what you think of it. If some people are interested in using the (future) lib, let me know what kind of functions you would like to see, so I can code something cool :).

(Technically, for now, you give an ASCII or UTF-8 string and the function returns an ASCII or UTF-8 string with the result or the 'corrected' input). I am planning to add a function which return a float number when it can.

 ;)

(Sorry if there are English mistakes)

Full topic here: http://tiplanet.org/forum/viewtopic.php?t=9198 (http://tiplanet.org/forum/viewtopic.php?t=9198)

PS: How are you supposed to write a post with these blinking smileys catching your attention  ;D?
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: DJ Omnimaga on May 01, 2012, 06:51:53 pm
This is awesome. But I lost the game :P
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: AzNg0d1030 on May 01, 2012, 08:28:21 pm
This is awesome. But I lost the game :P
Lol I saw that in the code too.  Trolling! XP
Good job though anyhow.  I would like some calculus tools for next year..
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: Jim Bauwens on May 02, 2012, 03:39:15 am
This is very nice :)
Finally might be able to start creating more non-games stuff through this, something that TI will like :P (They should help us with it!)

Quote
For those who know about Lua, math.eval() does returns a number. Here, it is more like expr(), and returns anything (in a string).
False, math.eval can return a string too when it cannot be represented as a number ;)
And in 3.2 you will have much more control over it too :)

Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: Chockosta on May 02, 2012, 06:35:40 am
This is awesome !
This is definetly really useful.

Great job :)
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: Scipi on May 02, 2012, 01:27:11 pm
Does this or will it happen to support symbolic integration?

If so, you are my hero :P
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: Lionel Debroux on May 02, 2012, 01:50:26 pm
FWIW, we've had proof for a year that it was possible to do CAS stuff on the Nspire using native code: http://www.ticalc.org/archives/files/fileinfo/437/43727.html ;)
But going further (e.g. making variables persistent in the document) requires documentation which TI is of course not providing, and too time-consuming to obtain by ourselves through reverse-engineering.
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: excale on May 02, 2012, 01:58:56 pm
Does this or will it happen to support symbolic integration?

If you have a Nspire (CX) CAS, then yes. I you have a non-CAS model, obviously no :D.
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: Scipi on May 02, 2012, 04:53:37 pm
Does this or will it happen to support symbolic integration?

If you have a Nspire (CX) CAS, then yes. I you have a non-CAS model, obviously no :D.

Ah. I have a Non-CAS DX
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: ExtendeD on May 03, 2012, 04:43:22 pm
Nice :)
But no download link yet?
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: excale on May 05, 2012, 03:44:19 pm
Nice :)
But no download link yet?
Well, the console program by itself is useless, and I still get some issues with some tricky points.
(Like making the Nspire open a new TNS file from luaext/hooks without rebooting :D)
By the way, are you planning to add Hook_remove? It would allow to make one-time hooks, which can be pretty usefull :).
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: neuronix on January 27, 2016, 11:22:09 am
Where is it possible to download this program?
I don't find it on TI-Planet.

Sorry for my english but I am French  :-\
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: unifire on March 07, 2016, 01:10:59 am
where is the Download link?
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: TIfanx1999 on March 07, 2016, 01:29:24 am
@neuronix and @unifire in the very first post click the TI-planet link. There's a download for the zip on TI-planet. It doesn't look like this was ever finished though.
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: unifire on March 07, 2016, 02:20:18 am
o yes the french site, i still cant find the zip but since you have checked it out i will take ur word for it,

Thank you very much
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: neuronix on March 08, 2016, 03:04:44 pm
Thank you very much.
I am registered on TI Planet ;)
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: TIfanx1999 on March 10, 2016, 06:30:46 pm
@neuronix You're welcome. ;)
Title: Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
Post by: neuronix on March 15, 2016, 12:06:00 pm
@Art_of_camelot Thank you  very much :)