British Transit Visa for a Persian Citizen Holder of a German Residence Permit

I am a Persian national citizen with a Persian passport, but I live in Germany and I have a German residence permit (located in the Schengen area). I go home (Persia) for Christmas from Stuttgart to London Heathrow and my flight will arrive at 20:25. Heathrow and my next flight is the next day at 8:10 am from Gatwick. I would like to know if I need a transit visa to move to the UK and go to Gatwick Airport for my other flight?
Thank you