Having trouble creating functions for scientific calculator
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Having trouble creating functions for scientific calculator
Hello!
I got tasked recently to create a calculator which i have managed to create a standard one with a few basic functions... The problem comes when i tried to escalate it into a scientific calculator which is actually just adding tan,cos,sin,tan-1,cos-1,sin-1 functions (I know that's not all to a scientific calculator haha but this'll suffice). Been stuck at these functions for awhile now.
Coming from a weak maths background i tried prowling the internet for information on the formulas but could not find one with a formula that could explain it in a way i understand. Could anyone offer any input or help on this?
Thanks!
Chrono
I got tasked recently to create a calculator which i have managed to create a standard one with a few basic functions... The problem comes when i tried to escalate it into a scientific calculator which is actually just adding tan,cos,sin,tan-1,cos-1,sin-1 functions (I know that's not all to a scientific calculator haha but this'll suffice). Been stuck at these functions for awhile now.
Coming from a weak maths background i tried prowling the internet for information on the formulas but could not find one with a formula that could explain it in a way i understand. Could anyone offer any input or help on this?
Thanks!
Chrono
- Attachments
-
- Scientific calculator.zip
- (1.5 KiB) Downloaded 168 times
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Having trouble creating functions for scientific calculator
As tan, sine, cosine and so forth are built into LiveCode
people like You and I can "cheat", and not get all worried about the shame
of being bad at Maths at school.
Make the Dictionary your friend
people like You and I can "cheat", and not get all worried about the shame
of being bad at Maths at school.
Make the Dictionary your friend
Re: Having trouble creating functions for scientific calculator
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Having trouble creating functions for scientific calculator
Here is one (by MaxV). Has more features than you need.
http://livecodeshare.runrev.com/stack/7 ... Calculator
http://livecodeshare.runrev.com/stack/7 ... Calculator
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Having trouble creating functions for scientific calculator
Hi.
As Richmond said, all the functions you mentioned are native to LC. So my question to you is this: Did you just not know that, or are you having difficulty implementing them?
In other words, and never mind how the user interface might work, are you able to simply:
And do you know that the arguments to trig functions are in radians?
Craig Newman
As Richmond said, all the functions you mentioned are native to LC. So my question to you is this: Did you just not know that, or are you having difficulty implementing them?
In other words, and never mind how the user interface might work, are you able to simply:
Code: Select all
on mouseup
ask "Enter angle"
if it is a number then answer sin(it)
end mouseUp
Craig Newman
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Having trouble creating functions for scientific calculator
That's stated explicitly in the dictionary.And do you know that the arguments to trig functions are in radians?
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Having trouble creating functions for scientific calculator
Yes, I know. And I even know what radians aredunbarx wrote:And do you know that the arguments to trig functions are in radians?
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Having trouble creating functions for scientific calculator
Ah.
Hermann is back.
Hermann is back.
Re: Having trouble creating functions for scientific calculator
Oh thats weird the first time i checked i only found atan, asin, acos which i have no idea what they meant. I tried looking it up in the dictionary before because i used sqrt for the calculator.richmond62 wrote: ↑Tue Nov 21, 2017 11:12 amAs tan, sine, cosine and so forth are built into LiveCode
people like You and I can "cheat", and not get all worried about the shame
of being bad at Maths at school.
Make the Dictionary your friend
sine.png
Thanks for pointing that out, will look through again.
Re: Having trouble creating functions for scientific calculator
Yes i would be able to code it. My mistake i missed the function out completelydunbarx wrote: ↑Tue Nov 21, 2017 3:00 pmHi.
As Richmond said, all the functions you mentioned are native to LC. So my question to you is this: Did you just not know that, or are you having difficulty implementing them?
In other words, and never mind how the user interface might work, are you able to simply:And do you know that the arguments to trig functions are in radians?Code: Select all
on mouseup ask "Enter angle" if it is a number then answer sin(it) end mouseUp
Craig Newman