Omnimaga > News

nCalc, calculus using the native Nspire's math engine with Ndl3ss

(1/4) > >>

excale:
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.

(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

PS: How are you supposed to write a post with these blinking smileys catching your attention  ;D?

DJ Omnimaga:
This is awesome. But I lost the game :P

AzNg0d1030:

--- Quote from: DJ_O on May 01, 2012, 06:51:53 pm ---This is awesome. But I lost the game :P

--- End quote ---
Lol I saw that in the code too.  Trolling! XP
Good job though anyhow.  I would like some calculus tools for next year..

Jim Bauwens:
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).
--- End quote ---
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 :)

Chockosta:
This is awesome !
This is definetly really useful.

Great job :)

Navigation

[0] Message Index

[#] Next page

Go to full version