Discuss Scratch
- gtoal
-
Scratcher
1000+ posts
Scratch Graphing Calculator
what's all this calculus about? I thought this was a numerical methods graphing calculator we were talking about, not a symbolic equation manipulator like Mathematica?Well technically the best way to graph would be to make sure that the graph went through all the maxima / minima, which I suppose *could* be found without calculus…
But in terms of derivatives, there's really no reason to *not* do them symbolically.
Yes there is. 1) you may not have a differentiable function
2) you may not know the function - you may only have point values
3) if this is for a calculator, you probably can't fit the whole of Mathematica into it.
4) it's a numerical methods program anyway
use something like Golden Section search.
- gtoal
-
Scratcher
1000+ posts
Scratch Graphing Calculator
Rather, I basically want to build a fully functional graphing calculator in Scratch as if I were programming in C (that is, the user does not need to edit the source code in order to modify the program).
Actually that's a useful trick in C too. Ever used dynamic linking?
G
- TheMonsterOfTheDeep
-
Scratcher
1000+ posts
Scratch Graphing Calculator
I mean for *this* calculator - I was only ever planning to make it consist of differentiable functions.what's all this calculus about? I thought this was a numerical methods graphing calculator we were talking about, not a symbolic equation manipulator like Mathematica?Well technically the best way to graph would be to make sure that the graph went through all the maxima / minima, which I suppose *could* be found without calculus…
But in terms of derivatives, there's really no reason to *not* do them symbolically.
Yes there is. 1) you may not have a differentiable function

As it were, calculus was never really a goal of this particular calculator - my main goal is simply to make a calculator, natively in Scratch, that does simple math. The other thing I want to do is make a nice and pretty equation editor - that's probably actually the next thing I'll work on (if I ever get around to working on this project again…)
The only reason I ever brought up calculus is because it is useful for graphical analysis of functions, and graphing is all about the graphical properties of functions.
I think the main problem is that I'm not making this to be a particularly useful calculator - I'm making it because I like the challenge it provides (mostly in terms of rendering…)
I suppose it would be cool to allow the user to build their own arbitrary functions, as Scratch is really easy to build functions with… I guess I probably will implement something like that at somepoint (if I continue working on this
) but I don't think it's one of my priorities.Actually that's a useful trick in C too. Ever used dynamic linking?No, I'm afraid not. Do you mean that a C graphing calculator should be able to utilize functions from arbitrary libraries at runtime? That's actually a really neat idea!
Sadly I don't think I'm quite there yet…

- gtoal
-
Scratcher
1000+ posts
Scratch Graphing Calculator
No, I'm afraid not. Do you mean that a C graphing calculator should be able to utilize functions from arbitrary libraries at runtime? That's actually a really neat idea!
Actually I meant a C program where the function you are testing is written in C on the fly and compiled and linked in to the program you're running, while it is still running.
- chooper100
-
Scratcher
500+ posts
Scratch Graphing Calculator
Actually I meant a C program where the function you are testing is written in C on the fly and compiled and linked in to the program you're running, while it is still running.
My gaping security hole senses are tingling…
Seriously, even if you put validation into it for certain expressions, it's never a good idea to compile code from user input
- Jonathan50
-
Scratcher
1000+ posts
Scratch Graphing Calculator
My gaping security hole senses are tingling…Seriously? The equations are entered in by the user. Why stop them if they really want to destroy their own computer?
Seriously, even if you put validation into it for certain expressions, it's never a good idea to compile code from user input
- chooper100
-
Scratcher
500+ posts
Scratch Graphing Calculator
I was thinking more in terms of malware using the software as a “proxy” almost to carry out whatever secret operations it wants to do



