Rectangular prism boundary 1 = 2.57
Rectangular prism boundary 2 = 2.57
Triangular prism boundary 2 = 1.37
Pentagram prism boundary 2 = 1.44
Note: You may get different values if you measured the angle differently. Don't be surprised if you're a few degrees different from me.
The key thing in this problem is to actually physically measure the angles. If you don't measure them, you can't calculate the answer.
Snell's law is
sin a1/sin a2 = n2/n1
where
a1 = angle of incidence of ray before boundary
a2 = angle of incidence of ray after boundary
n1 = index of refraction of medium before boundary
n2 = index of refraction of medium after boundary
The angle of incidence is the angle between the ray and the perpendicular to the boundary.
For the rectangle in the first figure, I measured the angle of incidence for the first boundary to be 45 degrees and 16 degrees for the first surface. And for the 2nd surface, I got measurements of 16 degrees and 45 degrees. So let's plug those values into the formula and see what happens.
First boundary:
sin a1/sin a2 = n2/n1
sin 45/sin 16 = n2/1.0
0.707106781/0.275637356 = n2/1.0
2.565351779 = n2/1.0
2.565351779 = n2
So the index of refraction is 2.57
Second boundary:
sin 16/sin 45 = 1.0/n1
0.275637356/0.707106781 = 1.0/n1
0.389810087 = 1.0/n1
0.389810087*n1 = 1.0
n1 = 1.0/0.389810087
n1 = 2.565351779
And it's no surprise that also shows an index of refraction of 2.57
For the right triangle on the same figure, the entry is parallel to the surface normal, so there's no data on the index of refraction for that ray. But it exits the triangle and the measurements I get is 45 degrees for the ray prior to the boundary and 75 degrees for the ray after the boundary. Assuming n = 1.0 for air outside the triangle, we get
sin 45/sin 75 = 1.0/n1
0.707106781/0.965925826 = 1.0/n1
0.732050808 = 1.0/n1
0.732050808*n1 = 1.0
n1 = 1.0/0.732050808
n1 = 1.366025404
And the index of refraction of the triangle is 1.37
For the pentagon:
Second boundary.
Incoming angle = 36 degrees
Outgoing angle = 58 degrees
So:
sin a1/sin a2 = n2/n1
sin 36/sin 58 = 1.0/n1
0.587785252/0.848048096 = 1.0/n1
0.693103675 = 1.0/n1
0.693103675*n1 = 1.0
n1 = 1.0/0.693103675
n1 = 1.442785597