Hi.
I'm just thinking this out of my head
You probably need to get the angle, then check the angle and you need 4 parts to check.
if 0-90 check for that part, if 90-180 check for that part same for 180-240 and 240 - 360.
then to calculate :
first you need to know the distance from left and up (you can set this in edit mode)
lets say left is 10 and top is 8.
this means there is a difference of 2.
lets say angle wound be 10. then do 90-10(angle), if angle would be 100 do 180 - 100(angle)
the result of this (80 in this sample) you need to divide by 90.
this will result in a value between 0 and 1 (angle result).
now do 2 * result(angle result) = 'add to base'.
This value might need to be inverted depending on what angle part.
to invert simply do 2- add to base = add to base inverted
now you can do 8 (shortest distance) + add to base (inverted)
Another way you could try is to set some colliders around the camera and use a 2nd raycast that will check for those colliders, get the distance an use that on the laser raycast.