File:Perspective Transform Diagram.png

Summary
Diagram of how perspective transform works in computer graphics

To determine which screen x coordinate corresponds to a point at Ax,Az multiply the point coordinates by:

$$screen\ x\ coordinate\ (Bx)\ =\ model\ x\ coordinate\ (Ax) \times \frac{distance\ from\ eye\ to\ screen\ (Bz)}{distance\ from\ eye\ to\ point\ (Az)}$$

the same works for the screen y coordinate:

$$screen\ y\ coordinate\ (By)\ =\ model\ y\ coordinate\ (Ay) \times \frac{distance\ from\ eye\ to\ screen\ (Bz)}{distance\ from\ eye\ to\ point\ (Az)}$$