# How to calculate solid angle of nonspherical surface?

My objective is to calculate (or find an expression) for the solid angle of a circular loop (parametrized by $$(x,y)=(r \cos{x_i}, r \cos{y_i})$$, where $$0\leq x, y \leq 2\pi$$) on the surface defined as:

$$\begin{split} h_{x}(x,y) &= t \left[ 1 + \cos(k \cdot b_{1} ) + \cos(k \cdot b_{2} ) \right ], \\ h_{y}(x,y) &= t \left[\sin(k \cdot b_{1} ) - \sin(k \cdot b_{2} ) \right ], \\ h_{z}(x,y) &= M - 2 t_{2} \sin{\phi} \sum_{i=1}^{3} \sin(k \cdot b_{i}), \end{split}$$

where $$k=(x,y)$$ is a row vector, $$b_i$$ are column vectors, $$t,t_2,M, \phi$$ are constants.

I plotted this surface, as seen below, and it appears as if it has regions where its surface normal vector points towards its center whereas other regions point outwards:

When normalized onto the unit sphere, and when the inward-pointing-normal-regions are highlighted in red, the surface looks like:

It appears as if the projection onto the sphere results in folding. However, according to Wikipedia (https://en.wikipedia.org/wiki/Solid_angle):

even if the projection on the unit sphere to the surface S is not isomorphic, the multiple folds are correctly considered according to the surface orientation described by the sign of the scalar product $${\hat {r}}\cdot {\hat {n}}$$.

How do I go about finding an expression for the solid angle of a loop on this surface? For instance, a loop could look like:

According to Wolfram (http://mathworld.wolfram.com/SolidAngle.html), the integrals for a relatively simpler cube seem hard to setup. Is the easiest way to do this numerically (using Mathematica, etc)?

To reiterate, I am trying to find an expression of the form (see Wikipedia article linked above):

$$\Omega ={\frac {A}{r^{2}}} =\iint \limits _{S}{\frac {{\hat {r}}\cdot {\hat {n}}\,d\Sigma }{r^{2}}}\$$

It is not clear to me how I could even go about starting to tackle this physics-inspired investigation, so I would appreciate any tips/resources/feedback-on-feasibility. Thanks!