Preheat the oven to 350℉ (175℃). Grease and flour two 9-inch round cake pans.
In a bowl, whisk together the flour, baking powder, baking soda, cinnamon, nutmeg, and salt.
In another bowl, beat the sugars, oil, and eggs until smooth. Gradually add the dry ingredients, then fold in the carrots, pineapple, and coconut (if using).
Divide the batter evenly between the pans. Bake for 25-30 minutes, or until a toothpick inserted comes out clean. Let cool completely.