Entries in the ‘Science’ Category:

Double Pendulum Simulation

I’ve been playing around with some of the new features in HTML5, particularly to see how the canvas stacks up to Flash. One of the things I wanted to test was javascript performance, so I ported this Flash toy I wrote a few years ago. It’s a physical simulation of a double pendulum system. It’s interactive, and it can export the line drawing it produces as a PNG.

How did canvas+JS do? The export was a lot easier: I had to write a PNG encoder in Actionscript for the original version! Pretty much everything else was harder. Canvas has features similar to Flash 5, and I missed modern Flash’s rich standard library. CSS layout is still somewhat inferior to Flex for GUI design, as the layout options are less flexible.

One of the appeals of canvas is mobile support, but I was disappointed by the performance on my Motorola Droid. Just clearing the background on a canvas larger than 500×200 took the frame rate to single digits, and I couldn’t find a reliable way to make the canvas fill the screen if other elements were present (I didn’t look too hard, since a canvas that large was unusable). The javascript performance was fine, it was just the drawing that caused problems. Let me know if you get better results on different hardware, I’d love to know that this can work better.

Overall, canvas shows promise, but I don’t think it’s ready to replace Flash for complex graphical applications.

Want to embed this on your own site? I’ve put an embeddable double pendulum simulation at Clockwork Magpie Studios.

Tags: , , , ,

Leave a Comment


Spin: The Game

Spin is a new Flash game I’ve been noodling on for a little while. It’s a Puzzle Bobble type game, except that the balls can freely spin like a pinwheel. The rotation is physically accurate, so as balls fall off of the board it changes speed and direction. When a ball hits the board the ball’s momentum is transferred to it, so if the board is turning slowly you can speed it up or make it turn the other way by firing the balls at it.

The feature list was miles long, but I’m getting too busy to work on it. Look forward to a second version when I can get back to it.

Tags: ,

Leave a Comment


The Future Was Yesterday?

Is futurism over? We mock the fantastical visions of future utopias that defined science reporting in the “nuclear age.” We’ve developed a feel for the slow pace of real technological development,1 so it only makes sense that we’ve all but abandoned the “Kitchen Of The Future!” style showmanship.

What I didn’t realize is how jaded we’ve become to incredible breakthroughs in science and technology. William Gibson writes,

Say it’s midway through the final year of the first decade of the 21st Century. Say that, last week, two things happened: scientists in China announced successful quantum teleportation over a distance of ten miles, while other scientists, in Maryland, announced the creation of an artificial, self-replicating genome. In this particular version of the 21st Century, which happens to be the one you’re living in, neither of these stories attracted a very great deal of attention.

Think about that. I did it, too. I read these headlines on Slashdot and didn’t even read the summary, because apparently quantum teleportation and artificial life aren’t surprising enough.

I wonder if my kids will even understand the kind of dreams we used to pin on the future. Will their generation develop its own version of futurism? Maybe they won’t have to dream of a fantastic world, because they’ll be able to make it real.


  1. Alvin Toffler’s estimation of ten years from research to commercial technology seems to be shortening. The eInk technology used in ebook readers only took a few years to commercialize after the first research was reported. 

Tags: , ,

Leave a Comment


There Is So Much Here To Discover

The alt text in today’s XKCD is a beautiful little poem.

Telescopes and bathyscapes
and sonar probes of Scottish lakes,
Tacoma Narrows bridge collapse
explained with abstract phase-space maps,
some x-ray slides, a music score,
Minard’s Napoleonic war:
the most exciting new frontier
is charting what’s already here.

I formatted the lines, so it might not scan the way Randall wanted. Tough.

Tags: , ,

Leave a Comment


Easy Scientific Notation In LaTeX

I use LaTeX for all my physics homework and lab reports, and I’ll be using it for a master’s thesis in the next few years, so I’m constantly adding to my library of LaTeX commands to save some typing. Here’s a good one when you need to use scientific or engineering notation. Put the following in the document preamble (before \begin{document}):


\providecommand{\e}[1]{\ensuremath{\times 10^{#1}}}
 

Then, typing


The [111] crystal planes are 3.2\e{-10} m apart.
 

gives you: The [111] crystal planes are 3.2×10-10 m apart. whether or not you’re already in a math environment. If the exponent is just one number, you can omit the braces, like this: 3\e8 m/s. Cool, huh?

(Of course, for 10-10 m you can just use Angstroms, \AA. If you’re in a math environment, use \text{\AA}, or else the circle won’t line up with the A. That is, if you’re okay with non-SI units.)

Tags: , , , , , ,

Comments (16)