If you're getting spotted by popping your periscope up for a mere few seconds, I'm guessing you've already been detected before doing so. Trying using your passive sonar to get a lock and then trace a line (using the ruler) by tracing over the sonar line from your sub to the target. That should give you a rough estimate on target range.