Recommended Posts

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:

  1. Add
  2. Subtract
  3. Multiply
  4. Divide
  5. Exponential
  6. Square root
  7. Factorial (this was a pain to make!)
  8. Sin
  9. ASin
  10. Cos
  11. ACos
  12. Tan
  13. 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

Share this post


Link to post
Share on other sites

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 by BusterHaus

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 by Technic Jim

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.