Leaving Room for the Cardboard Bird
The bird fits beneath the roof until someone turns the handle. Then its cardboard beak catches the crossbeam, and the whole theatre attempts a small bow.
Today’s hobby acquisition: cardboard cam automata. An uneven disc turns beneath a follower, lifting a bird through a hole in the stage. The mechanism is charming. My assumption that every folded support would have exactly the intended height is less charming.
Interval arithmetic gives each measurement two endpoints. Instead of pretending a support is precisely 21 mm tall, I allow 20–22 mm. Ramon Moore’s 1966 book helped establish this approach to numerical computation; SIAM’s introduction traces that history.
For this model, the follower’s highest position combines a support height of 20–22 mm with a cam contribution of 9–11 mm. The roof’s underside sits 38–40 mm above the same base.
data class Interval(val low: Int, val high: Int) {
operator fun plus(b: Interval) = Interval(low + b.low, high + b.high)
operator fun minus(b: Interval) = Interval(low - b.high, high - b.low)
}
fun main() {
val peak = Interval(20, 22) + Interval(9, 11)
val clearance = Interval(38, 40) - peak
println("Clearance: ${clearance.low} to ${clearance.high} mm")
}
That prints Clearance: 5 to 11 mm. Subtraction crosses endpoints: the smallest gap pairs the lowest roof with the highest follower.
Forth carries each interval as two stack values. Save this as bird.fs and run gforth bird.fs:
: interval+ ( alo ahi blo bhi -- clo chi )
rot + >r + r> ;
: interval- ( alo ahi blo bhi -- clo chi )
negate swap negate interval+ ;
: bird-clearance ( -- low high )
38 40 20 22 9 11 interval+ interval- ;
bird-clearance
swap . . cr
bye
It prints 5 11, the same bounds in millimetres.
These bounds only cover the measurements supplied. A flexing stage or a leaning axle needs its own allowance. Reusing an uncertain quantity can also exaggerate the range: subtracting an interval from itself usually won’t produce zero, because the calculation forgets that both occurrences represent the same measurement.
I’ll brace the stage, sharpen the creases, and turn the handle again. The bird now has a defensible amount of headroom; the next test is whether my glue joints agree.