Distances to the closest stars can be determined through measurement of their trigonometric parallax. The parsec was defined to be the distance at which 1 AU (perpendicular to the line of sight) subtends an angle of 1 arcsecond:
1 parsec (pc) = distance d when angle is 1 arcsecond = 3.086 1013 km = 3.26 ly
d = 1/p
where p is measured in arcseconds.