If 𝒛 rotates around the origin, √𝒛 will move in the same direction but half as far. That explains why there are two values for √𝒛.
Half way through the demo, this program swapped the colors of the two outputs, because of the path. However, any input will always produce the same two output values, regardless of the path.
What if we didn't save the path? What if we only knew the current input? One way to deal with this is to make a cut in the complex plane. We can see if this if we move the input without saving any previous values.
As you saw, each of the two outputs was well behaved as long as we didn't try to cross the cut.
As soon as the user saves a point, we automatically move the branch cut as far from that point as possible.
Let's draw four points to make a square.
The output made an octagon. But this is just a rough estimate. Let's try again with twice as many points.
Notice how the lines bow inwards and the angles have gotten smaller. Let's try again with a lot more points.
Since the input made right angles, the outputs should also make right angles. In calculus terminology, this function is a "conformal" or angle preserving mapping.
Let's try that same trick with an equilateral triangle.
As with the square, the outputs of the function make the same angles as the input. In this case they are all 60°.
Let's try that same trick with a 30° 60° 90° triangle.
Once again, the outputs of the function make the same angles as the input.
As the input approaches the branch point, the outputs all approach infinity. In complex analysis we say there is only one infinity. So all of the outputs would have the same value if the input was the branch point.
The natural log makes the most sense if think of the input in polar coordinates. The real part of the answer is based on the distance between the origin and the input. The imaginary part of the answer is based on the angle between the input and the positive real axis at the origin.
See what happens when you go around an individual branch point.
See what happens when you go around multiple branch points.
See what happens when you almost go around a branch point.