building howbigismypotato

The story of a page and a kitchen tool:

Thursday, July 06, 2006

No more sliding, just dragging

The sliders have gone. Now both calibration and measurement use the diagonal "drag me" icon. The hardest part of this exercise was learning the required javascript to intercept mouse events properly. In fact it was so hard that it isn't finished yet: it works fine in Firefox but it's utterly broken in IE. That's a problem for another day, probably a day that I have a PC available so I can actually run IE rather than guessing how it behaves.

There is some subtlety to the behaviour: on the calibration page the credit card outline maintains its aspect ratio, while the measurement potato outline can be stretched to any shape. This distinction probably won't be noticed by a user.

I had to think about the maths for a while. Confusingly I am now measuring two dimensions of a three-dimensional object. I toyed with inferring that the shortest measured dimension was probably closest to the unmeasured dimension, in which case I would square the short dimension and multiple by the long one to get the volume of the containing cuboid. However, I decided it was simpler to just raise both dimensions to the power of 1.5 and be done with it. I struggle to find a physical analogy for a length to the power of 1.5, but the maths seem to work.


Post a Comment

<< Home