There are endless possibilities for the next generation of mobile social applications that automatically determine your social context. A key element of such applications is ubiquitous and precise sensing of the people you interact with. Existing techniques that rely on deployed infrastructure to determine proximity are limited in availability and accuracy. Techniques that rely on specific frequencies or signal processing are not supported by widely deployed mobile devices. Virtual Compass is a peer-based relative positioning system that relies solely on the hardware and operating system support available on commodity mobile handhelds. It uses Wi-Fi and Bluetooth radios to detect nearby mobile devices and places them in a two-dimensional plane. Virtual Compass simultaneously uses multiple radios and multi-hop relaying to reduce distance estimation error and increase coverage. We use adaptive scanning and out-of-band coordination to explore trade-offs between energy consumption and the latency in detecting movement. We have implemented Virtual Compass on mobile phones and laptops, and we evaluate it using a sample application that senses social interactions between Facebook friends. Our experimental evaluation shows high accuracy and low latency with modest energy consumption.