Objects at a distance appear smaller because the visual angle they subtend becomes more acute with distance. The visual angle may be thought of as a triangle with the apex at the eye, and the distant object as its base.
The apparent height of an object is directly proportional to its actual height and inversely proportional to its distance from the eye. Apparent Height = Actual Height / Distance. So to find the actual height of a distant object, multiply its apparent height by its distance. Conversely, you can divide the known actual height of a distant object by its measured apparent height to arrive at the distance.
There is another geometrical distance relationship called the Inverse Square Law. This applies to all qualities projected by a distant object, including light bouncing off of its surface. Application of this law explains why a distant object may appear fainter than a near object: http://hyperphysics.phy-astr.gsu.edu/hbase/forces/isq.html.