The asymptotic size of the largest component in random geometric graphs with some application