A two-distance set in E(d) is a point set X in the d-dimensional Eucli
dean space such that the distances between distinct points in X assume
only two different nonzero values. Based on results From classical di
stance geometry, we develop an algorithm to classify, for a given d, a
ll maximal (largest possible) two-distance sets in E(d). Using this al
gorithm we have completed the full classification for all d less than
or equal to 7, and we have found one set in E(8) whose maximality foll
ows from Blokhuis' upper bound on sines of s-distance sets. While in t
he dimensions d less than or equal to 6 our classifications confirm th
e maximality of previously known sets, the results in E(7) and E(8) ar
e new. Their counterpart in dimension d greater than or equal to 10 is
a set of unit vectors with only two values of inner products in the L
orentz space R(d,l). The maximality of this set again follows from a b
ound due to Blokhuis. (C) 1997 Academic Press.