I think maybe we could add in complex number support, as well as things like this:
<(x)^(y)>, computes x^y,
<log (x) base (y)>, computes ln(x)/ln(y), the logarithm of x to base y,
and sin, cos, tan, asin, acos, and atan taken out of the sqrt, e^, 10^, log, ln, etc. menu and put in a block which is like this:
<[sin v] of (x) in [degrees v]>. Note that the first dropdown menu should contain sin, cos, tan, asin, acos, and atan and the second should contain degrees, radians, and hyperbolic.
Offline
Oh, sorry, it should have been:
I think maybe we could add in complex number support, as well as things like this:
<(x)^(y)> //computes x^y <log (x) base (y)> //computes ln(x)/ln(y), the logarithm of x to base y,
<[sin v] of (x) in [degrees v]>. Note that the first dropdown menu should contain sin, cos, tan, asin, acos, and atan and the second should contain degrees, radians, and hyperbolic.
Offline
Yes. Support. I'd love to choose degrees or radians and have better exponentation and logarithms.
Offline
Yep. Those would be useful as well. Maybe also secant.
Offline
Yes. I thought about it, then I decided that we could do 1 divided by the functions we already have, then I realized it would be just as much of a shortcut as tan(x)=sin(x)/cos(x). Also maybe cotangent and cosecant.
Offline
wiz99903 wrote:
Yes. I thought about it, then I decided that we could do 1 divided by the functions we already have, then I realized it would be just as much of a shortcut as tan(x)=sin(x)/cos(x). Also maybe cotangent and cosecant.
Yes, definitely.
Offline
Support, esp. the complex numbers. Would be realyl helpful for things like mandelbrot set, though you're going to have a hard time to explain it to the little kids.
Offline
You can (technically) do this (and anything) yourself in scratch as it is Turing complete. Scratch is a language for kids, and even many adults don't understand complex numbers and hyperbolic trigonometry. I support for maybe an "advanced scratch" or scratch with an advanced mode, but I really think it will confuse most scratchers.
Offline
Offline
In fact, I made a program that was supposed to be able to calculate exponentials and absolute values of complex numbers, until I realized that De Moivre's formula e^(ix)=cos(x)+sin(x)i, was being computed in radians. The code I used was:
say [I can calculate the exponential or absolute value of a complex number.] ask [What is the real part of the complex number?] and wait set [rez0 v] to (answer) ask [What is the imaginary part of the complex number?] and wait set [imz0 v] to (answer) ask [Do you want the exponential or absolute value of the number? (0=exponential, 1=absolute value)] and wait set [op v] to (answer) if <(op)=0> set [rez1 v] to <<[e^ v] of (rez0)>*<[cos v] of (imz0)>> set [imz1 v] to <<[e^ v] of (rez0)>*<[sin v] of (imz0)>> else if <(op)=1> set [rez1 v] to <[sqrt v] of <<(rez0)*(rez0)>+<(imz0)*(imz0)>>> set [imz1 v] to (0) endThe code should have been:
Offline
Sorry again! The code should have been:
say [I can calculate the exponential or absolute value of a complex number.] ask [What is the real part of the complex number?] and wait set [rez0 v] to (answer) ask [What is the imaginary part of the complex number?] and wait set [imz0 v] to (answer) ask [Do you want the exponential or absolute value of the number? (0=exponential, 1=absolute value)] and wait set [op v] to (answer) if <(op)=0> set [rez1 v] to <<[e^ v] of (rez0)>*<[cos v] of (imz0) in [radians v]>> set [imz1 v] to <<[e^ v] of (rez0)>*<[sin v] of (imz0) in [radians v]>> else if <(op)=1> set [rez1 v] to <[sqrt v] of <<(rez0)^2>+<(imz0)^2>>> set [imz1 v] to (0) end
Offline
wiz99903 wrote:
<(x)^(y)> //computes x^y<log (x) base (y)> //computes ln(x)/ln(y), the logarithm of x to base y
x^y is easily calculatable using repeats. It may not be efficient, but it works.
Why would you need a block to calculate ln(x)/ln(y) if there already exists ln(z) and a/b?
Last edited by kayybee (2012-10-31 20:20:53)
Offline
kayybee wrote:
wiz99903 wrote:
<(x)^(y)> //computes x^y<log (x) base (y)> //computes ln(x)/ln(y), the logarithm of x to base yx^y is easily calculatable using repeats. It may not be efficient, but it works.
Why would you need a block to calculate ln(x)/ln(y) if there already exists ln(z) and a/b?
Neither of those are there. I'm not sure if the log had a work around, I don't remember right now.. To the power of can be worked around with e and ln or the normal log and ^10. Still, these would be very useful.
Offline
wiz99903 wrote:
The complex number support would help me with my creation of complex number calculators.
Or perhaps you can code that yourself?
Scratch is about figuring out how to do things, not requesting things to make others easier.
It's possible to program a complex number system. It's just that each variable will need a countervariable for the imaginary part.
Or you can use one variable and make a script that can separate it like 5:-2 would be 5-2i.
Last edited by kayybee (2012-10-31 23:23:19)
Offline
wiz99903 wrote:
I would make a mod or something, except I don't know how to do it. Has anyone already made a mod?
It's not necessary to create a mod of Scratch just for a calculator; all you need to do is make your project compute complex numbers.
Offline
Funny, when I saw the title of this thread, I assumed when you were talking about complex numbers you were talking about this:
a + bi
and, I was wondering how you might use such a number in a script.
Last edited by BoltBait (2012-11-01 01:12:50)
Offline