Regarding the regular triangular prism with edge length #l#
a) The vector representing the edge #[B_1A_1]# is #vec v_1=(0,1,0)#
and the vector representing the edge #[BP]# is #vec v_2=(-sin(pi/3),cos(pi/3),1/2)# Now making the dot product #<< vec v_1,vec v_2 >> = cos(pi/3) ne 0# so #[B_1A_1]# and #[BP]# are not perpendicular.
b) The vector associated to the edge #[A A_1]# is #vec v_3=(0,0,1)#
and the vector associated to #[BP]# is #vec v_2=(-sin(pi/3),cos(pi/3),1/2)# so their dot product is #<< vec v_3,vec v_2 >> = 1/2#. We know that #<< vec v_3,vec v_2>> = norm (vec v_3)norm(vec v_2) cos(alpha)# so #cos(alpha)=(1/2)/( norm (vec v_3)norm(vec v_2) ) = (1/2)/(1cdot sqrt[5]/2) = sqrt(5)/5 ne sqrt(2)/2# so the angle between #[A A_1]# and #[BP]# is not #pi/4#