Rotate and move java processing

How do I get the bullet to always spawn at the top. The ways I tried make it spawn weirdly.