Need help with a Math problem

KeithRB:
I don't think it can optimise away function calls

I'm pretty sure that modern compilers are capable of optimising away function calls which are known not to have any side effects - I've been told so by somebody I trusted, anyway. (I'm less sure that they can be counted on to work out for themselves which functions have side effects, so that optimisation might only apply to 'well known' library functions, but it certainly does apply for some functions.)

Maybe it can only remove function calls in the same compilation unit. (i.e., current source and include files).

After all a function like this:

float average(float x)
{
    static float sum = 0;
    static float count = 0;
    count++;
    sum += x;
    return sum/count;
}

Should be called every time!

True, but that wouldn't apply to calls to standard trig functions, which would be prime candidates to be optimised out if the results were not used.

Are you sure your original formula is correct.

Azimuth/elevation is going to give you a direction over a spherical or hemispherical range.
X/Y is a location in a plane. Not the same thing.
Which sort of plane do you think you are mapping your hemisphere onto ?

Its used to steer not a Azimuth/Elevation rotor system but a XY rotor system.
They both point to a spot on the hemisphere.

If you can map a "hemisphere" to XY, well, good luck with that.