Code Geass follows the trajectory of Gundam way more than you might think, basically to the point of several characters actually syncing up: Lelouch/Char Aznable, Suzaku/Amuro Ray, Cornerlia/Kycilia Zabi, Clovis/Garma, etc. In all honesty I'd say it just changes Gundam's structure to instead follow the rival's perspective rather than that of the protagonist ... while also throwing in a Shoujo artstyle into the mix.
Code Geass doesn’t follow Gundam trajectory at all as confirmed by Creators. The similarities are mere tropes when all the characters you named for each series are far more nuanced and different.