Continuous incidence theory and its applications to number theory and geometry