Hi folks.

I'm trying to implement an algorithm that calculates the ratio of the projection area of the geometric body(parallelepiped for ex) to the area of a spherical segment pic here. Inputs are:

- coordinates of the center and vertices of a cuboid
- coordinates of the center of the sphere
- unit vector n (see pic)
- each spherical segment is known by its two angles (see pic)

I know how to define an area of a polygon by its spherical coordinates, but there are some special cases, and i don't know what to do with them. Any help is appreciated. Maybe there are some simple and elegant solution to the problem?