FABRIK, aka Forwards and Backwards Reaching Inverse Kinematics, is an inverse kinematics solver that I have replicated here. There are some settings if you move your mouse to the lower left corner, with the ability to turn on joint constraints (controlled with the list that appears), and to lock the third joint into a target angle. The circle around the mouse pointer is the arm's target. If the error, or distance between the mouse and the end effector, is less than 1 pixel, it is deemed sufficiently low and the circle turns green. There's a few more changeable settings in the project. Oh yeah, and the mini model in the bottom left corner is a representation of what the arm will actually look like, relying on the calculated angle values.
My first step in controlling a robotic arm. I wanted to figure out the code necessary before translating it to Python. I like Scratch for this reason because it allows me to get a very visual output that's useful for learning from. If anyone finds a better way to make the code for the joint constraint logic, please tell me. I was stuck on that for so long and eventually just decided to split it up into the forwards and backwards passes haha