Roger Joseph Boscovich between geometry and astronomy