Pages

Sunday, May 5, 2024

Making a Spectacle

This week I noticed something interesting about my shadow: I could see the lenses of my glasses casting a dark spot with the rest of my head. This made me curious, since I can see through my glasses, meaning light is passing through them, so why would they cast a shadow? Taking them off revealed an even more interesting effect:

There's a dark spot in the center, but a magnified brighter area around it. I decided to try some ray-tracing, a technique in optics where we consider beams of light coming from a source and follow their path through a system. Often this is done using matrix optics, in which lenses and other elements are represented by matrices which are multiplied together to create a system. Rather than deal with that directly though, we can use Python's RayTracing package to handle the math for us.

Lenses are typically defined by their focal length, which specifies the distance from the lens where parallel beams passing through it converge. However, glasses prescriptions are given in diopters, which are the inverse of the focal length. I'm nearsighted, which requires a lens around -5 diopters. The negative means that the convergence point is on the same side of the lens as the source. This is a little clearer with a diagram: Since the Sun is far away, its light is roughly parallel, so we can look at what my lenses do to a bunch of parallel beams (click to enlarge):

This shows the light being spread out by the lens – If you follow those lines to the left, they converge on the opposite side of the lens, corresponding to the negative focal length.

That accounts for the magnified bright spot we saw above, but it's only considering the light that goes into the lens – There's also light that goes past the lens on the sides. We can add together this light with what was redirected by the lens to get the total image:

The different lines show distances from the lens to the surface of the shadow. As in the picture that started this, we see a dark spot surrounded by a brighter area! What's interesting is that, because the beams from the Sun are parallel, the shadow (drop in intensity) stays the same size for all the distances, but the brighter area gets bigger or smaller. I've been wearing glasses since the 4th grade, but somehow this is the first I've wondered about their shadow – One of those blind spots that seems obvious once you see it.

Sunday, April 21, 2024

It's a Wash

[This post contains flashing images after the break. Photosensitive folks may want to skip it.]

I recently got this question from my Aunt Linda: I hate my washing machine because it is always off balance and knocks the shit out of itself. So I stare through the clear lid and try and figure out which piece of clothes is causing the problem. It really is trial and error. So I was thinking that the design should include 4 quadrant color distribution and help. Then I thought how fast the rotation is and where to spread out the different colors so they create the illusion of coming together visually by the timing of when the color is matching. Would there be a formula that would work at giving rotation and circumference?

Similar to a previous post on flickering lights, this question brings us into the field of psychophysics. I liked Linda's idea of using a color scale, so I decided to try animating an HSV color wheel with a wobble:

As Linda says, it's difficult to line up the color with the motion. My idea was to try to cut out the extra info by focusing on only a central slit. We can add some scale lines as well to help:

Now we can see pretty clearly that the red points are the heavy ones, pulling the washer out of alignment. Problem solved, right?

Sadly not. The images above are animated GIFs, which have a maximum frame rate of 100 frames per second. Washers on the other hand, tend to spin at over 1000 RPM. For the points I show, that would require 833 frames per second. We can get around the limit by exporting the animation as a giant block of HTML, but the result is pretty dizzying, so I'm going to paste it after the break. Thanks for a great question, Linda, though I wish I could have given you a more satisfying answer.