Technic Jim Posted June 16, 2016 Posted June 16, 2016 Hello all, I have been working on a Lego EV3 calculator recently and have incorporated quite a few functions into it.However, there are two functions I would like to add that I don't currently have. The functions that are already in it are as follows: Add Subtract Multiply Divide Exponential Square root Factorial (this was a pain to make!) Sin ASin Cos ACos Tan ATan The two that I would like to add are an Xth root of Y function and a Log() function. If anyone knows any way I can program these blocks or any ways you have seen yourself, please post a reply! Thanks, Jim Quote
__________________________ Posted June 16, 2016 Posted June 16, 2016 Interesting, I do not know how. Quote
BusterHaus Posted June 17, 2016 Posted June 17, 2016 (edited) You can write the Xth root of any number as the number with an exponent of 1/X. You already have the exponent function, time to apply it. Log() will also use the exponent function, this time a base number N with an exponent of X (X is your variable, N is defined once). Edited June 17, 2016 by BusterHaus Quote
TheMindGarage Posted June 17, 2016 Posted June 17, 2016 Finding the Xth root of Y is not too difficult. If you can make an xy function, finding the xth root of y is basically doing y1/x. As for log, there is a Log function in the Advanced section of the math block. If you want log of any number, use this: loga x = ln x / ln a. If you prefer to work with log10 instead of ln, it will work as well. Curious as to how you did the factorial. I'm guessing it was using recursion. Quote
Technic Jim Posted June 19, 2016 Author Posted June 19, 2016 (edited) You can write the Xth root of any number as the number with an exponent of 1/X. You already have the exponent function, time to apply it. Log() will also use the exponent function, this time a base number N with an exponent of X (X is your variable, N is defined once). Thanks, but what do you mean about the Log function? Finding the Xth root of Y is not too difficult. If you can make an xy function, finding the xth root of y is basically doing y1/x. As for log, there is a Log function in the Advanced section of the math block. If you want log of any number, use this: loga x = ln x / ln a. If you prefer to work with log10 instead of ln, it will work as well. Curious as to how you did the factorial. I'm guessing it was using recursion. Thanks, but I think the EV3 Log function is only log10 . I'll post the factorial program later. Edited June 19, 2016 by Technic Jim Quote
Technic Jim Posted June 19, 2016 Author Posted June 19, 2016 Sorry for the double post, but I've figured out a very easy way to do Logarithms using the following formula: logbx=logx/logb The fatorial program I made is also uploaded to Bricksafe. The one labelled 'mine' is one I made, and the one labelled 'his' is made by . The address is http://bricksafe.com/pages/Technic_Jim/lego-calculator#Cheers for all the help, Jim Quote
BusterHaus Posted June 20, 2016 Posted June 20, 2016 Thanks, but what do you mean about the Log function? Logarithmic expressions are written as X to the power of N. So it's a defined number X to the power of N. Since you already have the exponent function, all you need to do is apply it to the number X. Quote
Technic Jim Posted June 20, 2016 Author Posted June 20, 2016 Logarithmic expressions are written as X to the power of N. So it's a defined number X to the power of N. Since you already have the exponent function, all you need to do is apply it to the number X. Thanks, but I'll probably use my solution. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.