Solution: the intersection of e point is EG//BC, and the intersection of CD point is g point.
∵ABCD is a square.
∴∠B=∠C=90,AB//CD,AB=BC
△ in △ABP, ∠ BAP+∠ APB = 90, AB 2+BP 2 = AP 2.
∫AB = 12cm,BP=5cm
∴AP= 13cm
∵EF is perpendicular to AP in Q.
∴∠AQE=90
∴, ∠ EAQ+∠ AEQ = 90 in △AEQ.
∠∠BAP =∠EAQ
∴∠APB=∠AEQ
∫AB//CD
∴∠EFG=∠AEQ
∴∠APB=∠EFG
∫EG//BC,∠B=∠C=90
∴∠C=∠FGE=∠B=90
∴BCGE is a rectangle.
∴BC=EG
AB = BC
∴AB=EG
∠∠APB =∠EFG,∠B=∠FGE,AB=EG
∴△APB≌△EFG(AAS)
∴AP=EF= 13cm