AB = 1
The interior angle of the octagon = 135
The exterior angle PAB =360 / 8 = 45
Angle ABP = (360 -135) / 2 = 112.5
Angle APB = 180- 45 -112.5 = 22.5
Using the Law of Sines
PB / sin 45 = AB / sin 22.5
(sin 22.5) = sqrt [ ( 1 -sin 45 ) / 2 ] = sqrt [ (1 - sqrt (2)/2) /2 ] = sqrt [( 2 - sqrt (2)) / 4 ] = sqrt [ 2 -sqrt (2)] / 2
PB / (1/sqrt (2)) = 1 / ( sqrt [2 -sqrt (2) ] / 2) =
PB = 2 ( 1/sqrt (2)) / sqrt [2 -sqrt (2) ] = sqrt (2) / sqrt [ 2 -sqrt (2) ] =
sqrt [(2 ) * sqrt( 2 + sqrt(2)] / sqrt [ 4 -2 ] = sqrt (2) * sqrt (2 + sqrt (2) / sqrt (2)=
sqrt [ 2 + sqrt (2)]