what is an easy way to get the arduino to solve a polynomial of degree 4? Basically I am making a robotic arm, and did the painful inverse kinematics calculations to get a quartic equation, which if I can solve, I can find the right angle to move the servos to.

I need to know all real roots that satisfy the polynomial EQ. I know newton's method could be used but I dont want to have to code that and idk what a great starting point would be. Is there maybe a good library for this?

Also heres a picture of the robotic arm :) hehe

  • Calculating a fourth order polynomial is difficult, but you can use any algorithm that works on a PC on an arduino as well, as long as you get it to work with the limited memory you have. Can you elaborate on what algorithms you considered and why you think they are not appropriate?
    – PMF
    Nov 25 at 9:52
  • There’s a kinematics library on the arduino forum which claims to work on all architectures. I haven’t used it myself, but possibly worth a look. github.com/kousheekc/Kinematics
    – RowanP
    Nov 25 at 10:07
  • 1
    @RowanP I might consider that, but since I spent so long doing inverse kinematics calculations, I want to see if my calculations were correct and have the satisfaction of having coded it myself. Thanks though.
    – Simon Fox
    Nov 25 at 15:40
  • @PMF Well I remember from my calculus class that newton's method with the derivative and finding where the tangent line hits y=0 a bunch of times can get a good approximation for the roots of a polynomial. However, I have no clue how to code the starting points and make sure that all the real solutions are found (or let me know if there are none).
    – Simon Fox
    Nov 25 at 15:42
  • Well, it's been (too) long since I had my calculus classes, so I would have to read that up as well.
    – PMF
    Nov 25 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.