Using the Pythagorean theorem (Math) to find the distance of the mouse from the object Click to move the main point (thanks to @ggenije for the mag and vector tut) green = distance red = y blue = x