search
Sunday, 2018 February 25, 09:57 — curve-fitting

clothoid weekend update

For context, see past posts in the curve-fitting category that I just created. To recap:

The curves I’ve been drawing are the paths made by a point moving at constant speed at an angle which is a piecewise quadratic function of path length. Curvature, the first derivative of angle, is continuous.

Such a path that hits a given sequence of dots is fully determined if it loops, but otherwise it has two degrees of freedom. For any angle and curvature at the starting dot, there is a quadratic coefficient that lets the path reach the next node, and likewise for the next.

My current code starts with an estimate for the length of each segment (between two dots) and the angle at its midpoint, and uses these basis functions to fit those angles: a constant, a linear function, and a family of “solitons”: piecewise quadratics, zero outside a sequence of four dots, discontinuous in the second derivative at each of those dots. For n segments, there are n-2 solitons, so the constant and linear functions are needed to consume the last two degrees of freedom.

Eventually I noticed a flaw in this scheme: the curvature of the resulting path is the same at both ends, namely the slope of the linear component, because the solitons contribute nothing to it. That’s appropriate for ‘C’, but wrong for plenty of other strokes; in ‘S’ the end curvatures ought to have opposite sign.

The next thing I’ll try is a least-squares quadratic fit to the whole sequence, then fit the residues with solitons as before. That should be an improvement but it’s not ideal; curvature is a local feature. Perhaps I’ll think of something better later.

Saturday, 2018 February 24, 14:57 — cartoons

second-guessing by halves

Early strips of some webcomics carry the author’s much later comments. Christopher Baldwin (Bruno) and David Willis (Roomies!) are reposting old series that ended. David Morgan-Mar’s (Irregular Webcomic!) schedule these days is two new strips and five comments on old strips each week.

If it were me, I think I’d want to keep coming back to older strips, with ever decreasing frequency. Perhaps like this:

if n even:
    n /= 2
    comment on n
    while n even:
        n /= 2
        add n to backlog
else:
    pick a number from backlog; remove it
    comment on that entry
Wednesday, 2018 February 14, 23:20 — curve-fitting

un-meander


Here, each curve hits alternate dots: first exactly (above), then with offsets pushing it toward the other curve. Below is the result of eight iterations.

With enough iterations, the top of ‘s’ eventually gets a more symmetrical arch, as the change in curvature is spread more evenly.

But many runs get stuck in the fitting phase, and I don’t yet know why. Attacking one likely flaw didn’t help.

Sunday, 2018 February 11, 11:14 — curve-fitting

meander

(Previously: 2014, 2011, 2010; also, less closely related, 2015)

I tried to smoothen a stroke by shifting each dot toward the Euler spiral (aka clothoid, aka Cornu spiral) determined by its four nearest neighbors. That didn’t work so well: small wiggles were removed, but big ones were magnified.

( . . more . . )

Tuesday, 2017 November 7, 19:07 — pets

recruitment options

Mom mentioned a friend who once had two dogs, and when one died both she and the surviving dog took it hard; so now she keeps three dogs of staggered ages.

My cats are brothers, now six years old. I have long had in mind that in 2021 I’ll look to add one about 5yo – rather than get a kitten now, because older animals are harder to place.

But today at the shelter I saw many kittens whose data sheet said “would prefer to go home with a sibling,” and thought of saying, “Next time a batch of kittens is down to an odd one, call me and I’ll take it, if it’s not solid black (like Rocky and Bramble).” A sad proviso, but one must be practical.

Saturday, 2017 November 4, 09:30 — language

shibboleths?

In The Fall and Rise of Reginald Perrin, there are two yes-men: Tony, who likes to say “Great!”, and David, who likes to say “Super!”.

If I were writing it, their distinctive tics would instead be “in terms of ——” and “from a —— standpoint”. (They can share “on a —— basis”.)

Saturday, 2017 September 9, 20:01 — merch

a poster


Sometimes I search my blog for this picture and scratch my head in puzzlement that it’s not here, before remembering that I posted it on Google Plus back when I used that.

So here it is. Stephen Guerin (the shaven one) displays his canvas print of one of my designs.

The colors came out better than I hoped, in stark contrast to a couple of mugs with related designs that I got from the same shop.

« Previous PageNext Page »