We use data on variable stars from the Optical Gravitational Lensing Experiment ( OGLE III ) survey to determine the three-dimensional structure of the Small Magellanic Cloud ( SMC ) . Deriving individual distances to RR Lyrae stars and Cepheids we investigate the distribution of these tracers of the old and young population in the SMC . Photometrically estimated metallicities are used to determine the distances to 1494 RR Lyrae stars , which have typical ages greater than 9 Gyr . For 2522 Cepheids , with ages of a few tens to a few hundred Myr , distances are calculated using their period-luminosity relation . Individual reddening estimates from the intrinsic color of each star are used to obtain high precision three-dimensional maps . The distances of RR Lyrae stars and Cepheids are in very good agreement with each other . The median distance of the RR Lyrae stars is found to be 61.5 \pm 3.4 kpc . For the Cepheids a median distance of 63.1 \pm 3.0 kpc is obtained . Both populations show an extended scale height , with 2.0 \pm 0.4 kpc for the RR Lyrae stars and 2.7 \pm 0.3 kpc for the Cepheids . This confirms the large depth of the SMC suggested by a number of earlier studies . The young population is very differently oriented than the old stars . While we find an inclination angle of 7 ^ { \circ } \pm 15 ^ { \circ } and a position angle of 83 ^ { \circ } \pm 21 ^ { \circ } for the RR Lyrae stars , for the Cepheids an inclination of 74 ^ { \circ } \pm 9 ^ { \circ } and a position angle of 66 ^ { \circ } \pm 15 ^ { \circ } is obtained . The RR Lyrae stars show a fairly homogeneous distribution , while the Cepheids follow roughly the distribution of the bar with their northeastern part being closer to us than the southwestern part of the bar . Interactions between the SMC , LMC , and Milky Way are presumably responsible for the tilted , elongated structure of the young population of the SMC .