Thursday, February 08, 2007

Finessing, with Trig

Adventure in a rather flatter environment today; the cartesian plane. An interesting problem came my way this morning, and I found it so exquisitely satisfying to solve that I decided to set out my journey across said plane for the edification of my readership. I realise that many of you will be starting out rather sceptical that words like “elegant” belong on even the same page as a mathematical formula; what I want to give you is sense of my own wonder that such fearsome beasts as trigonometric functions can be whispered and coaxed into perfect co-operation, solving problems with no apparent relation to geometry – and the sheer pleasure of mathematical tinkering.


For anyone still reading, my problem was this: a certain object is to be drawn by a computer using two very different devices. This object has an opacity ranging between 1 (opaque) and zero (invisible); now, the artist has found that his favoured opacity value looks nice on one output device, but a little too solid on the other. He doesn't want to set the opacity twice - he just wants his picture to "look right" on the second device. Clearly, I need a "creative" way to interpret my picky artist's choice of opacity.

Perhaps I could simply halve the value used for the "too solid" device? No, that wouldn't do; a setting of "fully opaque" would give a solid rendering on one device, and a semi-transparent from the other.

Clearly, I needed a more elegant function; some formula that would "preserve" the start and end values (1 and 0), yet interpret intermediate values in a way that improves (increases) the transparency for the second device. Since the default(x) forms a straight line, I realised that I need a curve to get “under” x while still starting and ending at the same points. Below, you can see a chart like the one I used to hunt for my function; x and x/2 form straight lines, while the functions sine, cosine and tan form various curves. The tan (purple) gave me an “aha!” moment. True, it did not start precisely at 1; but it “dived” beautifully at first, before leveling out and settling gently onto zero.


Nearly there; to make my formula start at 1, I needed to “squash” it to fit my range: I scaled it by adding an extra term: now, I had tan(x) * 1 / tan(x). Much better! Now, my curve started and finished with the line for x – but I wasn't happy yet. Wouldn't an even steeper gradient be better? It occurred to me that squaring x might be the answer: numbers between 1 and 0 get smaller when squared. For example, 0.8 squares to 0.64, and 0.5 squares to 0.25 – while, handily, 1 squares to 1 and 0 to 0 – perfect! Adjusting our formula one last time, we arrive at tan(x^2) * 1 / tan(x) – or, visually, a curve which precisely fits the range we needed, swooping gracefully towards full transparency. If the (elegantly!) fudged transparency values still don't quite suit our artist, higher or lower powers of the first x in our formula can be used to “tune” the dip of our curve to his taste.

Monday, January 15, 2007

Business & Pleasure, Part the Second

Continued from a previous post, we rejoin our protagonist the morning after a rather painful return to the ski slopes, high in the magical Bernese Oberland.


Just after dawn on Sunday morning, I limped back to the cable car through light drizzle; a blanket of low cloud gave the valley a rather melancholy look. Rather than continue to Murren, I stopped at Winteregg; at this height, the weather was a little better - snow was falling. An old chairlift dropped me off at the head of a couple of friendly-looking blue runs - deserted, except for a small group practicing with a rescue sleigh. Making cautious turns on the empty pistes, I soon realised that something had changed overnight: my balance, and the rhythm of my turns were transformed.

I rode the Winteregg lift once more, but this time turned my skis south, towards Murren. Emboldened by an uneventful run down a red piste, I decided to give Birg one more try. Good decision: long before it reached Birg, the cable car broke through into clear skies. Although some cloud remained on the Schilthorn and across the valley a mantle of cumulus hung across the summits of the Eiger, Monch and Jungfrau; a brisk breeze whipped around the Birg, and I began the traverse that leads from the peak into the valley below.

Minutes later, I knew my old "ski legs" were back at last; I let my turns lengthen, relishing the freezing wind on my face as my skis cut a fresh path down near-empty pistes. The vanished clouds had left a sprinkling of fresh powder, and each turn kicked another puff of snow into that clear, clear air; as the piste steepened, the falling powder began to keep pace with me, and I, tightening my turns, cut through the tumbling debris of my own descent.


Riding a chairlift back up so as to have another run to the Kandahar station, I had the leisure to discover an eerily beautiful example of turbulence in action; the high ridges above me were continuously throwing off weird eddies in the air - currents all turned in upon themselves, horizontal twisters, made visible to me by snow crystals they carried, more brilliant than any diamond against the deep, deep blue of the high-altitude sky.

That morning is still fresh in my mind; the thrill of rediscovery as I took again the steepest line down the piste, rhythm and balance restored, careless of gradients that I would hardly dare tackle on foot; how the cloud veil fell silently into the valleys, until sheer self-preservation brought me to a halt at the margin of the piste, so that I could stand in silent and awestruck wonder, that any living land could be so beautiful.

A week on, my business in Stuttgart completed, a certain date in February beckons from my calendar; more Alpine adventures to follow...

Friday, January 12, 2007

Business & Pleasure

Business brought me to Europe; pleasure led to arrive on a Friday rather than a Sunday, in Zurich rather than Stuttgart, and to take a succession of (very punctual!) trains to the village of Lauterbrunnen, in which I arrived around 22:30 to find the valley moonlit and snowbound.

The next morning, I rode a cable car up to Grutschalp; our cable car was met by a tiny two-carriage train, and a gigantic luggage tray was lifted by robotic forklift from beneath the cable car on onto a kind of trailer on the train. After a minute or two, we moved off, gliding almost silently in the direction of the village of Murren; a short run, but one of the most beautiful train journeys that I have ever taken. The track traversed a very steep slope, about 2,000ft above the valley floor; all about us stood a pine forest, with snow thick on the boughs. Between the trees, I caught glimpses of an epic scene to the east - the great trio of the Eiger, Monsch, and Jungfrau, all over 13,000ft in height, the old green ice of the gravity-defying glaciers on their northward faces just visible beneath thick blankets of fresh snow; on their lower slopes, great pine forests grow on improbably steep slopes and at the very lip of tremendous cliffs; here and there, mysteriously treeless ground reveals the violence done by the avalanches from winters past.

Skiers rise past the infamous Eiger Nordwand

I last saw Murren on a misty day in late May; this time, I arrived in bright sunshine to find the narrow streets covered not, as I remembered, with wet tarmac, but with snow. Murren is a car-free village (except for a single 4 wheel drive taxi), and people with things to carry (such as luggage or small children) tow small wooden sleighs behind them (just like the ones in Victorian Christmas cards). Although there appear to have been one or two unfortunate lapses of planning in the ‘60s or ‘70s, much of the village is postcard-pretty. A short stroll took me to a cable car, which whisked me to a height of 2600M or so - which is where the trouble began!


The rest of Saturday, I remember as a blur of majestic, awe-inspiring landscapes, skies of a blue that verged on Indigo - and a regular series of spectacular wipeouts, in which practically every piece of equipment became liberated at one time or another. At one point, in fact, I was under the impression that a particularly violent fall had sundered the bones of one of my favourite legs; on another occasion, after a fumbled turn at the edge of a steep and unguarded drop, I departed the mountain altogether, my descent only arrested by the pliant but sturdy branches of a serendipitously placed bush. After 8 hours or so of such performances, it was a very sorry-looking figure indeed who steered gingerly past a piste-basher beginning its night shift, removed his skies, and trudged slowly, painfully, back to his lodgings.


To be continued...

Wednesday, December 20, 2006

High Times

Once more, a retrospective post, but this time, something in the nature of a prequel, as will be revealed in the coming weeks...

Some years ago, business took me to a small town in the Schwarzwald - a place with a real fairy-tale feel. I still remember coming over a rise and seeing the extent of the forest of the first time - dark pine to the horizon. Within the forest itself, I saw picture-perfect wooden farmhouses and churches; and late one afternoon, I watched from beside the world's largest cuckoo clock (!) as a doe and her fawn stepped cautiously in to a meadow at the edge of the trees; the fawn was a ringer for Bambia.

Meetings over, I drove south from the forest; I still remember the perfection of that late-spring afternoon, driving a very new BMW past vineyard after vineyard. Then, Lake Constance came in view, and the beauty was too much: time to pull over. In front of me lay the vast blueness that the Germans call the Bodensee; beyond that, the air was clean and clear enough to reveal the great jagged snowy mass of the Alps - 50 kilometres away, in Switzerland.

The fairytale theme was continued at the lake shore, in the ancient island-town of Lindau. I reached the lake, and the old town of Lindau. The town is full of beautiful old German buildings, many of which have beautiful murals on their exterior walls. The most thematically relevant of these was a tower from which a painted Rapunzel had let down her long blonde locks, about 10 metres of them, to assist her waiting rescuer.

Unlike Rapunzel, I was not long delayed by the tower; reluctantly abandoning that beautiful BMW, I took a ferry from Friedrichshafen south across the lake, to Romanshorn in Switzerland (possibly the last country I had expected to reach by boat!). From there, a succession of trains brought me further south, first over gently rolling farmland; then gliding along the shores of the improbable, surreal powder-blue of Lake Thun; and finally, from Interlaken into the truly magical, numinous valley of Lauterbrunnen - better known to Tolkien fans as Rivendell. At this point, our fairy-tale theme is becoming an epic one: the valley sits below the trio of Jungfrau, Monch and the infamous Eiger.


The next day, I rode a cog-train up above Grindelwald. Abandoning rails for boots, a short hike up a ridge to the east of the infamous Eiger nordwand took me - standing in the very heart of Europe - beyond any sight or sign of man. Above me, cloud obscured the highest peaks; below, another layer filled the valley floors, and I stood alone in a world of naked rock and vast snowfields. Above me, glaciers sloped at improbably steep angles from unseen peaks; just beyond the relative safety of my ridge lay the scene pictured here - the debris from a vast avalanche.

Now, several years later and working in a very different role, I am expected at another meeting in the south of Germany - but first, I think I'll make a little detour...

Thursday, November 30, 2006

Sailing

Three weeks to the winter solstice; dark outside, gale force winds, lashing rain and a thick overcast cover the closest thousand miles of ocean. Months since I've been afloat, and I'm missing the sea - time for a wander down memory lane.



Two autumns ago, I was standing on the fore-deck of a nicely fitted-out 40ft Beneteau, the great white masses of an unreefed main sail and genoa carrying us steadily west along the coast. To starboard, I caught a glimpse of a fin slicing through the water towards us; then, within seconds, they closed the gap, and we had an escort of dolphin outriders. Just a few feet separated me and the dolphins playing in our bow wave. They have no fear of us, or the great bulk of the yacht; and, in their playfulness, we see something that reminds us of ourselves.

Eventually, the dolphins appeared to decide that a fast yacht under full canvas was a little too slow for their taste, and upped their pace a little; within a few minutes, they were lost to sight, and we, once more, were alone on the ocean.

Wednesday, November 15, 2006

The Pounce

Last night, our cat was suspiciously happy to be spending time outdoors, for reasons which soon became apparent: he had found a new "playmate", and was having the time of his, that is to say, his victim's life.



The poor mouse had a rough time, I'm afraid: batted into the air, pounced on, bitten, and then released for a few seconds for the fun of re-capturing it. Occasionally, it landed close to cover and tried to run - but cats are fast.

We are living with a little furry psychopath.

Tuesday, November 07, 2006

Well-met by Moonlight

Returning to the city close to the witching hour on a misty, moonlit night, we crossed the Blackwater at Lismore Castle and stopped to take this picture. Just across the bridge, we just missed getting a really special shot: a fox was waiting by the roadside.




On seeing us, he drew back, then stopped. Parked 15 metres away, we rolled the window down and started shooting; alas, without effect. Our external flash and our longest lense were both in the boot, buried beneath weekend bags and walking gear. We sat in silence for several minutes: we watched the fox, and he watched us. Eventually, he slipped into the shadow of the forest beside the road, and we moved on.