If θ is the angle with the vertical, the angle with the horizontal is (90-θ). KE at top = E sin²(90-θ) = E cos²θ. PE at top = Total E - KE at top = E - E cos²θ = E sin²θ. [The source answer C is for angle with horizontal].