a) Exact answer:
[erased]
b) Player answer:
By watching some videos, my understanding is that you are visually spotted from within 8 km, unless the weather is bad (foggy, low light) or the sea is rough in which case assume you are not yet spotted at that distance, but you are going to be if you get much closer. You may even intercept enemy's radio message about a detection, but don't count on that
At night you must have the moon in your back (or is it in front?) or you will get spotted more quickly.
I think in all cases there is some randomness involved.