Gantry-couch collision is a serious concern for treatment planning of the linear accelerator (linac) based stereotactic radiosurgery (SRS). The ability to detect collision at the time of planning eliminates the need for backup plans and preserves the useful beam angles that would be deemed unsafe and discarded otherwise. Most collision-detection schemes embedded in commercial planning software guard only against the most apparent collisions. On the other hand, a fool-proof collision-map or lookup table often requires detailed measurement of machine geometry and complex graphic operations. In this study, we have developed a simple analytical method for collision detection with the use of quick machine-specific measurements. The collision detection is mathematically solved by determining whether two facets in three-dimensional space, representing gantry and couch surfaces, intersect with each other. A computer code was implemented and tested on a Varian Clinac 600C linac equipped with a BrainLab micromultileaf collimator (MLC) device. To measure machine-specific parameters, the lesion isocenter was set to the origin of the stereotactic coordinate system. The reference coordinates of couch bracket corners and micro-MLC to the linac isocenter were measured only once in the treatment room before they were incorporated into the computer program. Couch, gantry, and collimator were subsequently translated and rotated to study the clearance of various beam arrangements and lesion locations. Predicted results were verified at the machine. Our method correctly confirmed clearance for a retrospective study of 54 previously treated SRS plans (76 isocenters). It also accurately predicted the collisions for all ten artificially created cases. In conclusion, we have developed an analytical method for SRS collision detection that is accurate, easy to implement, and computationally inexpensive.