I have posted this in the earth science forums, but i didn't get a answer, so i am trying my luck here.

I am trying to write a matlab script which calculates the gravity anomaly of a dipping prism, using the equations of Hjelt, published in Geoexploration in 1974, issue 1 volume 12.

Δg=G.Δρ.T0

where

and

at the end of the page there are two notes, the second one says:

"Note 2: The sign of each ϕ is positive, whenever there is an even number of 2s in the indices

of u, v and w. (u1 - v1 - w1, u1 - v2 - w2, etc.)"

I just can't get my head around what exactly this means and how to apply it.I have expanded the equations for each ϕ, using the limits for u, v and w, but they are very long, so will post them only if needed.