We know that:
The angle at the centre is twice the angle at the circumference.
When we make the chord AB an actual diameter, the angle at the centre is a straight line angle (i.e. 180°) and so the inscribed angle at the circumference will be a right-angle (i.e. 90°).
The angle in a semi-circle is a right-angle.
Watch this video to appreciate that the position of the point P does not matter as long as it remains on the circumference.