Is there some formula/code out there that would compute the surface

of the intersection of two disks?

(of slightly different radiuses, and that can fully overlap).

I have started writing such a function, but it's full of special

cases and surface decompositions (disk slices, triangles, etc.),

and I'm not sure I am confident about the results it gives...

My aim is to use it to compute penumbra textures (for eclipses),

so it would essentially intersect a moon disk with a sun disk,

and use the remaining (visible) sun disk surface to compute lighting

intensity.

Of course, I could always paint the two disks on a huge bitmap and

count color-coded pixels, but that isn't very satisfying. :)

Thanks.

Eric Grange

http://glscene.org