Move your mouse! Try it here: phosphorus.github.io/#65356436 I am about to upload one allowing individual control of the length of each arm.
This is just a test for a project that will follow. The length slider changes the length of the arm. Recently learned about the law of cosines and decided to use it. How it Works -It works by making a triangle (in the math). Both parts of the arm are the same size and make up two sides of the triangle. The third side is the distance between the mouse pointer and the center. -With the side lengths it then uses the law of cosines to find the visible angle (C). It then takes that, subtracts it from 180º, divides it by two and I have the rest of the angles (A and B). It points toward the mouse, turns angle A degrees, and moves half of the arm length, then just points at the mouse and moves the rest of the way. Law of Cosines: A, B, C are angles. a, b, c are sides opposite of the corresponding angles. a²=b²+c²-2×b×cos(A)