OK – but it’s a little hard to describe without a diagram.
delta = toWorld(anchorPoint) – thisComp.activeCamera.toWorld([0,0,0]);
This line just calculates the vector (distance and direction) from the camera to the layer. It looks complicated because it’s using the toWorld() layer space transform to convert the layer and camera positions to world coordinates. This is only necessary if the layer or the camera is the child of another layer, but it makes the expression more general to assume that’s the case. If you don’t have to worry about parenting, you could use something like this instead:
delta = position – thisComp.activeCamera.positon;
The next line:
radiansToDegrees(Math.atan2(delta[0],delta[2]))
This is pure trig. Looking from the top, the vector calculated in the first line defines the y rotation that you need to get the layer to turn towards the camera. That y rotation can be calculated from the arc tangent of the x and z components of the vector (that’s what atan2() does). JavaScript represents angles in radians, but AE’s rotation property expects degrees, so we use radiansToDegrees() to do the conversion.
Hope that helps – it’s a lot to bite off if you aren’t comfortable with a little vector math and trig.
Dan