Monday, April 20, 2009

Differential Equations (Agnew, 1960)

Among my many, many other books is a red hardcover textbook entitled, simply and accurately, Differential Equations, by Ralph Palmer Agnew. It was first published in 1942; the second edition, which is the one I own, was printed in 1960.

It does not, I should emphasize, appear to be the copy of that edition that has gone missing from the National Library of Australia.

I obtained it, not from a bookseller, but from a furniture store — probably sometime in the mid-1990s: while my parents were shopping for, I think, a new couch, I entertained myself with a book; and, as they did end up making their purchase there, the salesman was kind enough to throw it in when I asked after it.

It is, strangely, the oldest book I own. Anyone who knows me reasonably well would probably expect me to own much older books than this, but if I do I can't find them anywhere. (I do have a number of Edgar Rice Burroughs novels in storage, but the oldest are the the 1973 Ballantine editions of the Barsoom series, with cover art by Gino D'Achille.)

It has a peculiar sense of humor: dry, self-aware, but detached and unintrusive. I never did finish it. (Nor did I ever grok diffy-Qs as well as I felt I ought, even when I studied them formally in college; but that's neither here nor there.)

Sunday, April 19, 2009

Dream (not a dream)

The Princess of Dream smiled her vacant smile in response, as the clouds of sweet pink smoke encircling her began to drift toward me. "Oh, yes, Sir Violet. I know. Why, it happens every morning, does it not? This realm is, after all, maya: destined to be rewoven nightly in sleep, and torn asunder daily in waking."

I carefully ignored the smoke; it curled suggestively, but approached no further. "Lady Dream, I do not mean this realm. The waking world will be ended, and with it all Oneiria!"

She leaned back upon her throne of silks and pillows, the smoke receding with her; and though no part of her face seemed to move, her half-lidded expression was no longer empty and blissful, but sharp as shattered ice. "Then destiny will be no more, nor illusion reign again."

And the Princess of Dream laughed. It was beautiful and melodious, and in thirteen years of service to My Lady of Nightmares I had never heard anything that chilled my blood so.

"Go!" she cried, as her court began to vanish in billows of dark pink smoke. "Return whence you came, Rider in the Dark, and tell my sister she will receive no aid from me: for the nightmare of Nightmares is the dream of Dreams."



Why is so much of my fiction in first-person?

Saturday, April 18, 2009

Flood

Sounds like the sort of thing I'd title a fiction piece (and probably will!), but today it's a statement of fact. My apartment complex is flooded — or the internal roads, are, anyway, easily enough to flood my poor Corolla. Several people who parked in less elevated areas than I did (and/or had low-riders: and who gets low-riders in a flood-prone area? Idiots, that's who) have had their cars flooded. I've been watching the water levels for a while, and it has gone down steadily ever since the rain mostly stopped at about ... what, 16:00? It vaguely drizzled for a while after that, but the clouds were already starting to pass by.

It's much like it was two years ago, or just after Hurricane Ike; people are coming out of their apartments and walking around. I've spoken to more of my complex-mates in the last five hours than I have in the five months preceding — yes, even during the snow day. (People were more interested in the snow than in each other, mostly. Or keeping an eye on the kids.)

Sorry; no pictures. It didn't really seem worth it this time, not like it did two years ago when it amazed me. Really, this is almost just a day in the life.

Friday, April 17, 2009

Entertainment

The local Fry's Electronics has far too many (soft) DDR pads in stock; it's kind of worrying, for no reason I can immediately put my finger on. However, they're about ten dollars each, so recently I decided to replace my existing, well-worn soft pad with two such of similar manufacture.

Furthermore, although a number of the Fry's employees I asked had no idea whether it was the case, it turns out that they do also sell Duck Tape, if you know where to look.

Thus, for the princely sum of roughly twenty-five dollars, I am now the proud owner of this affront to the eyes:


Surprisingly it performs rather well. While dancing there "feels" like there's an inch-high barrier between the two pads: there isn't, really, it's just a byproduct of the way they're taped together (there is a slight peak of less than 1cm where the black trims of the two pads meet, due to their natural upwards curvature), combined with my natural lack of grace and thus my propensity for letting my feet hit that peak.

I should note that I have considered getting a hard pad, or a even pair thereof; but it doesn't really seem like a worthwhile option — by the time I go through enough soft pads that a hard pad would have been worthwhile, the game consoles I dance with will have changed, and the connectors (or wireless protocols) built into the hard pad will no longer be usable!

Thursday, April 16, 2009

More bounding box blatherskeit

The previous definition of bounding box, or something mildly similar, could also arise from adding two additional elements to the domain of `⊴` — call them `⊴_bot` and `⊴_top` — which act respectively as a global infimum and supremum on `⊴`. These elements have a natural representation in `bbb F^n` (where `bbb F` is the set of IEEE floating-point numbers, of whatever precision is relevant) as, respectively, {-Inf, -Inf, ... -Inf} and {+Inf, +Inf, ... +Inf}.

This would imply the existence of semi-infinite bounding boxes extending either positivewards or negativewards on all axes, as well as the existence of the "world box" as the `sube`-supremum. However, the null box would still not be a bounding box under this definition; and the semi-infinite boxes don't have much use for, er, actually computing the bounding boxes of objects or sets. (The world box is at least a useful initial value for foldr `^^`!)

However, in vector spaces constructed as products of sets with with minimal and maximal elements — such as `[0, 2^{:2^{:n:}:}-1] nn NN` or the aforementioned `bbb F` — the local equivalent of `⊴` is already a bounded lattice, naturally yielding the `sube`-supremum as a bounding box in that space without defining it specially.

My initial definition — refined from the above `{⊴_bot, ⊴_top}`-conjoinment, which was itself refined into the definition in the previous entry — was closer to the actual final representation. Perhaps it would be more natural to study the behaviour of posets of pairs of points from lattices, like the representation itself, than to consider "boxes" to be actual delimited sets of points?

Wednesday, April 15, 2009

Bounding boxes

Select some fixed `n` and basis `\vec{e_i}, 1 lt i le n` of `RR^n`.

Define a relation `⊴` on points in `RR^n` such that `a ⊴ b` iff `forall i: (a.p_1 * \vec{e_i}) le (b.p_1 * \vec{e_i})`. Then (`RR^n`, `⊴`) is a poset, and in fact is also a lattice: the meet `a ^^ b` is merely the point `sum_{i=1}^n [ \vec{e_i} * max(a * \vec{e_i},b * \vec{e_i})]`, and the join is the same, with `min` substituting for `max`.

Let a bounding box be a set of points `B sube RR^n` such that a point `p in RR^n` is in `B` iff `vvv B ⊴ p ⊴ ^^^ B`. Intuitively (using the standard basis for `RR^n`), this is an axis-aligned closed box. A bounding box is uniquely defined by its `⊴`-infimum and `⊴`-supremum. (Note that these two points may be equal if `B` is the singleton set containing only that point; this is a perfectly legal bounding box.)

The relation `sube` defines a poset on the set `bbb B` of bounding-boxes, simply because it also defines one on the powerset of `RR^n`. We may use `sube` to extend `bbb B` into a join-semilattice: the join of two boxes `A` and `B` is the box defined by the `⊴`-infimum and `⊴`-supremum of `A uu B`.

The join is not always in `bbb B`, but we can extend `bbb B` to a complete lattice `bbb B^+` by adding two additional special bounding boxes not defined by their `⊴`-infimum and `⊴`-supremum: the nil box `bot = O/` and the world box `top = RR^n`. Then `(bbb B^+,sube)` is a proper lattice, in which the join is still defined as above (with global supremum `top`), and the meet is merely the intersection. Technically only `bot` is needed to make `bbb B^+` a lattice, but the inclusion of `top` makes it a bounded lattice, which is useful.



From a practical perspective, a bounding box may be conveniently represented as a pair of `n`-tuples of IEEE floats. Naively it might appear that we need an additional two bits — one to mark a degenerate case, and the other to distinguish between the two such — but with a small amount of cleverness in the representation, we can avoid both the additional two bits and the need for any special logic in the implementation of meet, join, or containment-of-point.

Specifically, we represent `top` as the pair of `n`-tuples `(-infty,-infty,...,-infty),(+infty,+infty,...,+infty)`, and `bot` as any pair `(a,b)` such that `a⋬b`, possibly with a canonical form `(+infty,+infty,...,+infty),(-infty,-infty,...,-infty)`. The large class of representations of `bot` makes equality testing slightly more difficult, but equality is a much rarer operation to perform on bounding boxes than meet, join, and containment. The natural implementations of binary meet on nondegenerate boxes (taking the min of each element of the left two tuples, and the max of each element of the right two), binary join (as meet, with max and min reversed), and containment-of-point (left[i] <= point[i] && point[i] <= right[i] for all i) naturally work with these as well.

Note that if we are working with integer boxes instead of floating-point, we cannot typically use `infty` as a value. However, most applications for integer bounding boxes involve an implicit universe of discourse (the size of the screen or what-have-you), and where this does not hold, -MAX_INT and MAX_INT will probably still do in practice.

Tuesday, April 14, 2009

In a body

The walls of the vein were long dry — wrinkled, shriveled, and petrified, resulting in a surface that would almost have been easier to climb, at least at an angle, than to walk.

Unfortunately, the dead god's bier was flatter than Kansas (and wouldn't that be an interesting simile to try to explain, I thought briefly), so we were stuck trudging through the "tunnel" on foot.

"At least it hasn't collapsed," I murmured, half unaware. Dovan flinched as I said it — he'd been ill at ease the entire way — and made a sign with his left hand that I'd come to recognize as a ward against ill fortune. I realized I'd said it aloud, and also flinched, though in my case out of embarrassment at my faux pas rather than any real fear. "Yeah," I said, and shook my head. "Any idea how much farther?"

"As far as it is," he snapped. "Why do you humans ask such useless questions?"

I blinked. "Well, I can't speak for anyone else, or even myself at any other time, but right now it's because if I'm making meaningless conversation it keeps me from thinking. Which means it keeps me specifically from thinking about how unutterably screwed we probably are, since, really, that's the only thing there is to think about until we get there."

Dovan didn't say anything to that for a long moment, as we passed another vein joining the inferior vena cava. "So," he said, with discernable forced cheer, "what's the weather like where you come from?"

I snrked. Possibly no dwarf had ever asked that question honestly. I tried to keep it interesting. "Hot and humid. I live near the coast, almost on flood plains. The soil's really porous, so you can't really build underground..."