Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Following a proud tradition of doing ridiculous things because we can, Cemetech's latest side-side-side project will do something a bit more useful. Long have I yearned for a beautiful 3D graph add-in to accompany the beautiful, high-resolution color screen on my trusty Casio Prizm calculator. Unfortunately, issues such as time constraints and no system calls that hook Casio's CAS have prevented this from becoming a reality. That changed a few months ago when Cemetech user AHelper, well-known for his upcoming GlassOS third-party TI-84+ operating system, decided to release source and information about his gCAS2 library. This nifty set of functions and support routines turns a string holding an equation into an AST (a tree representing the equation) and can then produce a numerical answer. It's currently still somewhat limited, and I tracked down a number of errors, but with that plus some custom color-mapping and 3D rendering code of my own, I produced a program that can graph any 3D equation.

Of course, it is still quite rudimentary. Although I've begun a single-line text input routine for entering equations, currently the equation to be graphed is compiled into the program (although it still calculates all points and colors on-the-fly on the Prizm!). Things like an adjustable window and zoom and rotation are coming soon, although I have a good idea of how they'll work. Trig functions including sin, cos, and tan are not yet in gCAS2, and there are glitches with certain types of coefficients. Nevertheless, as I find time, I hope to gradually bring this to an educational-grade, very useful 3D graphing program!

As always, feedback, comments, and suggestions are welcome. And don't forget that if you pre-order my upcoming beginner programming / TI-BASIC book, Programming the TI-83+/84+ before March 6th, there's a 50% off code, "TI8384".

The following is a graph of Z=((X*X+Y*Y)/4)-5;
NIce thing! I want to try this as fast I can!
very nice Kerm!

Wonderful. This would have been more useful some months ago when I was learning basic equations and conditionals in space at school, but I'm sure it will be very interesting to play with now too Smile

Keep up the good work, Kerm!
Thanks, guys! Once I get rotation working and have manual equation entry at least sort of functional, I'll release an alpha for you all to play with.
you should have it so you can enter in diffrent equations, like xyz plot, x=, y=, z=, and maybe plain old 0=ax+by+cz.
KermMartian wrote:
Following a proud tradition of doing ridiculous things because we can,
That's the spirit!

But I really can't wait for this. There aren't too many add-ins for the Prizm yet, but as far as I can see it's nearly all high-quality stuff that's really useful or fun.

And color 3D graphs are epic.
Also I would love it more if the rainbow effect stayed.
Krazy, the latter is like z=-(ax+by)/c. I see that the Nspire will get parametric graphing in OS 3.2, so I should add it, but that's a secondary concern.
It's sad that Casio didn't allow for a way for us to take advantage of their internal math routines, though I'm not surprised and from what I saw in the docs for their older calculators it seems they re-implement the math routines in every addin which is rather retarded.

That said, Nice work Kerm, this is rather impressive. And props to AHelper as well.
Very nice work, KermM! Glad to see that gCAS2 eventually worked! Will there be a proof-of-concept add-in released (just to see it on a real screen, not necessarily for the source)?

If you modified the library source, can you post a patch? Also, if anyone wants to help expand gCAS2, please do! I currently have too many projects being worked on right now.

Lastly, about the input, you can look at Clock's code. I have a custom text-input routine in there, however the text input routine that I added documentation for on the prizm wiki is probably what you are looking for Smile
Quote:
Lastly, about the input, you can look at Clock's code. I have a custom text-input routine in there, however the text input routine that I added documentation for on the prizm wiki is probably what you are looking for Smile
Superb, I will definitely look into that. And yes, I need to upstream my patches soon.

Jonimus: Yeah, it's quite unfortunate. And thanks for the props; I'm excited about this project.

Everyone: So I decided to switch to doing real perspective rendering, instead of my own effective (but hacky) method. Wikipedia gave me the basics of 3D projection. SourceForge provided information about the ex/ey/ez variables, which Wikipedia did not describe well. I also found a thread about fast/accurate sine and cosine that did better than other Taylor and polynomial series-based methods. With a bit of rotation code added to graph3DP, the result is recognizeable as a graph, but seriously needs some proper frustrum-based discard and intelligently-sloped clipping.

Fixed your link ~elfprince
Looks pretty promising Kerm. Some people complains is that the PRIZM lacks many features the TI-Nspire has, especially since OS 3.1. 3D graphing is often a cited one. Hopefully more math tools adding features the Nspire has are made for the Prizm, to bring it on-par for school users and, hopefully, increase their sales (and the amount of Prizm users)
KermMartian wrote:
I also found a thread about fast/accurate sine and cosine that did better than other Taylor and polynomial series-based methods.

It would be most awesome if you had an algorithm for general exponentiation with complex arguments.
For technical things, such as graphs, I prefer an orthographic projection over a perspective projection. I'm probably never going to use this program, but I'm just putting that out there. It would also be computationally less expensive, as you'd only have to find the translation factor for one point, and it could be used for all the points.
I would prefer an orthographic projection as well, and it would certainly make my life easier, but I think I at least need a perspective option. I was very surprised to go pull out my TI-89 just now and realize it does indeed do orthographic projection, which I did not think was the case.

Elfprince: you mean A^B for all A, B? It already does that, if so. Smile
@Elfprince: Unless you mean complex numbers like 1+2i, or if you mean x^(y^2/2)
That's an impressive display. I sadly would have no use for a program such as this, but it looks great Smile Can't wait to see some more awesome screenshots come about.
KermMartian wrote:
you mean A^B for all A, B?

in particular, where A, B are elements of C, rather than R?
elfprince13 wrote:
KermMartian wrote:
you mean A^B for all A, B?

in particular, where A, B are elements of C, rather than R?
Hmm, I hadn't really considered that. Can Matlab and/or the TI-89 do such magic?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement