Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
21 May, 2013, 11:46:18 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: nCalc, calculus using the native Nspire's math engine with Ndl3ss -  (Read 1176 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
excale
LV3 Member (Next: 100)
***
Offline Offline

Last Login: Today at 06:45:38
Date Registered: 10 December, 2010, 21:56:04
Posts: 80

Topic starter
Total Post Ratings: +16

View Profile
« on: 02 May, 2012, 00:14:45 »
+4

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 Smiley.

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 Smiley.

(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.

 Wink

(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  Grin?
Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 08:22:03
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50208


Total Post Ratings: +2613

View Profile WWW
« Reply #1 on: 02 May, 2012, 00:51:53 »
0

This is awesome. But I lost the game Tongue
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
AzNg0d1030
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 19 May, 2013, 23:04:34
Date Registered: 26 October, 2011, 04:43:09
Location: Over the rainbow
Posts: 488


Total Post Ratings: +37

View Profile
« Reply #2 on: 02 May, 2012, 02:28:21 »
0

This is awesome. But I lost the game Tongue
Lol I saw that in the code too.  Trolling! XP
Good job though anyhow.  I would like some calculus tools for next year..
Logged

What? WHAT? WHATTTT?Huh??

You just lost the game.

Suck it up.
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 00:39:35
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #3 on: 02 May, 2012, 09:39:15 »
0

This is very nice Smiley
Finally might be able to start creating more non-games stuff through this, something that TI will like Tongue (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 Wink
And in 3.2 you will have much more control over it too Smiley

Logged

Chockosta
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Yesterday at 15:15:35
Date Registered: 03 June, 2011, 20:14:17
Location: France
Posts: 440


Total Post Ratings: +159

View Profile
« Reply #4 on: 02 May, 2012, 12:35:40 »
0

This is awesome !
This is definetly really useful.

Great job Smiley
Logged

Chockosta (Loic Pujet) - Sorry for my poor English...
Look at my projects :
in C code : Periodic table, Space invaders, Fall, Snake, Minesweeper, nCraft (WIP)
in Lua : Snake, Space invaders, Bobby Carrot, Minesweeper, Mazes 3D, nSpaint, FreeCell, Tiny3D-Viewer, CubeField, Gravity Guy
Scipi
Omni Kitten Meow~ =^ω^=
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 11:34:02
Date Registered: 12 September, 2010, 08:35:24
Location: Lost Town
Posts: 1380


Total Post Ratings: +145

View Profile WWW
« Reply #5 on: 02 May, 2012, 19:27:11 »
0

Does this or will it happen to support symbolic integration?

If so, you are my hero Tongue
Logged



Spoiler for Things I find interesting:
Spoiler for AI Programming:
Spoiler for Historical warfare/Formations(Warning: Large images):
Phalanx

Testudo

Schiltron

Better version
Terico

Line

Square

Spoiler for Shameless advertising:

Spoiler for OldSig:
Imma Cat! =^_^= (Make this an emoticon!)





Spoiler for IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Spoiler for Misc:


Spoiler for Goosed stuff:
FUSION-TIME GO!
Lionel Debroux
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 07:35:20
Date Registered: 17 December, 2009, 09:37:25
Location: France
Posts: 1853

Total Post Ratings: +208

View Profile WWW
« Reply #6 on: 02 May, 2012, 19:50:26 »
0

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 Wink
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.
Logged

Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.
excale
LV3 Member (Next: 100)
***
Offline Offline

Last Login: Today at 06:45:38
Date Registered: 10 December, 2010, 21:56:04
Posts: 80

Topic starter
Total Post Ratings: +16

View Profile
« Reply #7 on: 02 May, 2012, 19:58:56 »
0

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 Cheesy.
Logged
Scipi
Omni Kitten Meow~ =^ω^=
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 11:34:02
Date Registered: 12 September, 2010, 08:35:24
Location: Lost Town
Posts: 1380


Total Post Ratings: +145

View Profile WWW
« Reply #8 on: 02 May, 2012, 22:53:37 »
0

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 Cheesy.

Ah. I have a Non-CAS DX
Logged



Spoiler for Things I find interesting:
Spoiler for AI Programming:
Spoiler for Historical warfare/Formations(Warning: Large images):
Phalanx

Testudo

Schiltron

Better version
Terico

Line

Square

Spoiler for Shameless advertising:

Spoiler for OldSig:
Imma Cat! =^_^= (Make this an emoticon!)





Spoiler for IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Spoiler for Misc:


Spoiler for Goosed stuff:
FUSION-TIME GO!
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:47:13
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #9 on: 03 May, 2012, 22:43:22 »
0

Nice Smiley
But no download link yet?
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
excale
LV3 Member (Next: 100)
***
Offline Offline

Last Login: Today at 06:45:38
Date Registered: 10 December, 2010, 21:56:04
Posts: 80

Topic starter
Total Post Ratings: +16

View Profile
« Reply #10 on: 05 May, 2012, 21:44:19 »
0

Nice Smiley
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 Cheesy)
By the way, are you planning to add Hook_remove? It would allow to make one-time hooks, which can be pretty usefull Smiley.
« Last Edit: 05 May, 2012, 21:45:00 by excale » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.287 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.