Vector math nodes in Blender 2.82 simplifies this node tree. Using vector math nodes for the modulus, absolute value, subtraction, and scaling accomplishes these tasks with one node. The rotation of the second gradient can be accomplished by the cross product function. The product is with (0, 1, -1).
ssveusb Andrew nice ! Indeed as often with nodes there's more than one way to achieve the same results. Also this tutorial was done with the beta release of blender 2.80, so the vector maths nodes was not that elaborated.
/Thibaut.