# What is the average rotation angle needed to change the color of a sphere?

A sphere is painted in black and white. We are looking in the direction of the center of the sphere and see, in the direction of our vision, a point with a given color. When the sphere is rotated, at the end of the rotation we might see the same or a different color.

The coloring of the sphere is given; we know how the white and black color is distributed. The coloring is also "nice" (no fractals); the black patches have borders that are smooth and infinitely differentiable curves. How can I calculate the average angle required to change from black to white?

The question is very general. So a simple sub-case would be: if one hemisphere of the sphere is black, the other is white, and if one starts in a situation where the random starting point is black, what would the average angle be?

Starting from this subcase, what would be the way to calculate the average angle for a general black-and-white coloring?

-
How much of the sphere do you see? Just a point? Otherwise, how do you deal with seeing some black and some white? – Ross Millikan May 11 '11 at 13:30
@Marc: You posed two related questions (math.stackexchange.com/questions/38451/…); it would make sense to link them to each other. – joriki May 11 '11 at 14:12
your question is very imprecise. what about the axis or rotation? how is the random angle choose ? (from a uniform distribution?) – leonbloy May 11 '11 at 14:40
@leonbloy: There is no mention of a random angle in the question. The only reference to randomness is in "rotated randomly". I would interpret that to mean "rotated by a rotation drawn from a uniform distribution with respect to the Haar measure on $SO(3)$". This leads to a uniform distribution of resulting points on the sphere with respect to surface area (see my answer to the related question I linked to in the above comment). – joriki May 11 '11 at 14:56
@Marc: It's not clear (to me) what you mean by "required". If you mean "the minimum angle by which we need to rotate the sphere to see the other colour", then that doesn't fit with rotating the sphere randomly. If that's what you're interested in, it would make sense to choose a random starting point instead; then you could ask what, averaged over all starting points, is the average minimum angle of rotation required to change colours. Is that what you meant? – joriki May 11 '11 at 15:00

For the general case you can define a function that assigns to each point on the sphere the distance (angle) to the nearest boundary. The desired number is then the integral of this function over the whole sphere (see example by Joriki). For the sphere, we can consider, for example, circular regions (a hemisphere is a special case). Inside a small circular region (cap) the distance function looks like a little cone, centered at the center of the circle. If the black (and therefore also the white) regions are made up of unions, intersection or differences of caps the distance function can be constructed from the distance functions for each of the caps. Note that the colors are irrelevant. The only thing that matters is the distance to the nearest boundary. All you need is the list of circles. Performing the integration exactly would not be easy. The case of two non-overlapping caps is doable (non-intersecting circles). For a set of circles that is not too large, you could use Monte Carlo integration (for a random set of points, average the distance to the nearest circle). Easy to implement, but not very efficient. Monte Carlo would also work for more general cases.

You could consider intersections of hemispheres as the equivalent of polygons on a sphere. So the ideas described above apply to the case of "polygonal" regions on the sphere.

If you approximate your boundary by a discrete set of points you can probably use a Voronoi diagram.

Note that this kind of question is much easier to think about on a unit square (with periodic boundary conditions) or easier still on a unit interval (with periodic boundary conditions). In the latter case, the distance function for an arbitrary partition is made up of "hats" with slopes of 1 and -1. The integration is easy to perform in this case.

http://en.wikipedia.org/wiki/Signed_distance_function

http://en.wikipedia.org/wiki/Medial_axis

-
Thank you! This is very helpful. – Marc May 12 '11 at 8:32

If one hemisphere is black and the other white, choose spherical coordinates such that the border between the colours is at the equator. Then the rotation angle required to change colours is $|\theta|$, where $\theta$ is the latitude. So the average angle is

$$\frac{\int_{-\pi/2}^{\pi/2}|\theta|\cos \theta\mathrm d\theta}{\int_{-\pi/2}^{\pi/2}\cos \theta\mathrm d\theta}= \int_0^{\pi/2}\theta\cos\theta\mathrm d\theta=\left[\theta\sin\theta+\cos\theta\right]_0^{\pi/2}=\frac{\pi}{2}-1\;.$$

I don't see how anything useful could be said about the general case.

-
Thank you! This is a nice result, around 32 degrees. I have never seen this angle value before. – Marc May 12 '11 at 8:33