I've tried this through Mathematica, and hit my own limit in math ability trying to do this, both to no avail. I'm assuming there is no way to do so, as a simple solution to this problem would be a breakthrough for Ray Tracing, but WHY is it so difficult to integrate a euclidean distance function. (and by extension, the surrounding trigonometric functions)
$\int {\cos {\sqrt {x^2+y^2+z^2}}dx}$
I find myself REALLY wanting to accomplish this for the sake of a project I'm working on, and only being able to do this via Riemann sums makes for a VASTLY inferior calculation. The full equation is much uglier than this, but the stumbling block is this part.
Here's the full equation I'm working with at the moment. (There is a corresponding sin equation as well, the combination of which is used to determine the phase offset)
$\int_{\text{vs}}^{\text{ve}} \left(\int_{\text{us}}^{\text{ue}} \text{Cos}\left[\frac{\sqrt{(-\text{px}+\text{t4}+\text{t1} u+\text{t2} v)^2+(-\text{py}+\text{t8}+\text{t5} u+\text{t6} v)^2+(\text{t12}+\text{t9} u+\text{t10} v)^2}}{w}\right.] \, du\right) \, dv$
There are a lot of variables here because I'm a little too much computer background, and too little math background. u,v are defined over the range us-ue,vs-ve, (hence the integral ranges) and t[1-16] are components of a 4x4 translation matrix that pushes the 2d surface u,v into 3d coordinates. p[x,y] is the location of the holographic plate "pixel" being computed. w is the wavelength of light under consideration. The idea is to push the same equation to multiple cores on the GPU, each with a different pixel co-ordinate.
For the purposes of a single computation, all t,p and w variables are constants. us and ue cannot be taken for granted unfortulately as there is the possibility that us and ue are functions of v, however, vs and ve would be constants.
The idea here is to create a holographic plate representation of a surface instead of a point. I don't want to do Riemann sums because it creates holes, and I have the distinct impression that it's terribly inefficient.
Yes, this is what I originally posted to MathOverflow.
I simplified the equation above using the Fourier Aproximation, and then further reduced it's complexity using Euler's Formula. I can't speak to the efficiency of calculation of Euler's formula vs the integral of a Cos/Sin pair, but, it is technically more correct since I'm talking in electromagnetic waves anyway. The resulting Complex Amplitude actually seems to give the correct answer, as I can demonstrate through pictures more easily than words.
The speed of calculation slows down to a crawl the moment I try to do any rotations of the u,v coordinate surface, and I'm guessing that's because a whole bunch of terms zero out when it's parallel to the z=0 plane, and don't when it's not. Making the z coordinate of the surface a function of u,v also has a similar computational hit, which is unfortunate, because that's one of the easier ways to make a continuous wavefront pattern from a z-buffer.
In any event, here are the graphics I generated to test whether I was on the right track or not with my calculations, and they actually match the real wavefront pattern surprisingly well. Take a gander if you're interested: