Skip to content

Monthly Archives: June 2006

A block on a sphere

29-Jun-06

There is a fairly common problem in elementary physics class that goes something like this:

A small block slides from rest from the top of a frictionless sphere. How far below the top does it lose contact with the sphere? The sphere does not move.

—paraphrased from problem 4.6 of An Introduction to Mechanics by Kleppner/Kolenkow
It’s fairly […]

On the qsort() comparison function

23-Jun-06
When asked to write a comparison function for qsort()ing an int array, one might write it like so: int cmp_int(const void *a, const void *b) { if(*(const int *)a < *(const int *)b) return -1; if(*(const int *)a > *(const int *)b) return +1;   return 0; } But after reading the manpage for qsort(), in […]

Torricelli’s Equation

21-Jun-06

I was reminded recently of a useful kinematics equation usually learned in high-school physics:

Strangely enough, it seems that not many people recognize this equation—apparently sometimes known as Torricelli’s equation—as conservation of mechanical energy in disguise. Even the Wikipedia articles mentioning it don’t make the connection.
Starting with conservation of mechanical energy with T and U […]

LaTeX! LilyPond!

18-Jun-06

Whoa, I got LaTeX and Lilypond working in WordPress with FigureRender. Cool stuff!

The only bump in the road was the fact that my host is running PHP4 and FigureRender was written for PHP5. The changes to make it work in PHP4 were pretty trivial, though, so I hacked up a patch. I […]