You wrote that flux=BAcostheta
But according to definition, magnetic flux shows number of magnetic field lines passing through surface area (of course we know at 90 degree).
All right flux=BA cos 90
flux = 0
But maxium flux when at 90 therefore, I think something wrong with the formula!!!