Why then did not anyone give a proper formula?
We've given methods. Plus it's not too easy to write maths in a forum post.
If o is the length of the ship according to the ruler, O the length in reality, a the distance of the ruler from your eye, and A the distance of the ship, the formula would be:
A = O/tan(tan
-1(o/a))
Which can clearly be simplified to:
A = Oa/o
Until you have found a ship that you know has length 100m, and measured a distance of 5km from it, and looked at it with a ruler from 5cm from your eye (absurdly close), and found it looks like 10cm, you simply have no grounds for your incredulity. I very much doubt you've even attempted this in real life, but if you have the numbers you've given us are simply wrong.
You can even test this formula on a small scale, without leaving your room.
You've been answered. Until you have a real life example rather than a made up situation which you're clearly struggling to visualize, don't act like you haven't been.