Hi guys,
I would like to know if there is a fonction for square root? I looked for one and i didn't see any.
I need to know the hypotenuse of a triangle.
Thank you!
Is there a way to calculate the square root?
-
Gariep -
January 3, 2014 at 7:32 PM -
Thread is marked as Resolved.
-
-
Hi there,
You have several options:
1. Use Newton's square root approximation (√ N ≈ ½(N/A + A))
2. Use the Math Function Option if you have it.
3. Use iRMath if you have it. There are functions for both linear distance and x^y, which can be used to find square root (x^0.5)
4. Write your own KAREL program if you have the option -
Karel has the SQRT function built in. All robots from R30ia and older will run karel written programs even if KAREL was not installed on the controller. The new R30ib will only run karel files if you have the option paid for and loaded.
Easy to pass a value from TPE to a register and then call the Karel file to do the math function you need and return the result to another register.
Good Luck -Eric
-
Hi there,You have several options:
1. Use Newton's square root approximation (√ N ≈ ½(N/A + A))
Thank you about that,
never heard of it.
Simple solution