search
Saturday, 2014 May 10, 16:30 — curve-fitting, neep-neep

naming is hard

I often have trouble giving meaningful concise names to variables in the programs I write, perhaps because, until I reach for the keyboard, my thinking is largely nonverbal. I suspect that it would be less of a problem for someone more exposed to the accumulated lore of programmer culture; though perhaps not in this case:

I’m thinking of breaking up this process into multiple rounds, to obtain increasing degrees of geometric continuity. The initial nodes would coincide with the input dots but have no defined theta (tangent angle) or kappa (curvature); the first round of replacements determines theta for G¹ continuity, the next round determines kappa (the first derivative of theta) for G² continuity — and subsequent rounds may seek higher degrees of continuity by matching further derivatives.

This means that the node object, instead of exactly two fields called theta and kappa, should have a list of theta and its known derivatives (one more than the current replacement-round needs), and I’m at a loss for a good name for this list.

• comment by Anton — Saturday, 2014 May 10, 16:45

It’s like listing the coefficients of a Taylor polynomial, though here they’re not divided by k!.

• comment by Anton — Saturday, 2014 May 10, 17:09

I just thought of a case where relaxation (from the most naïve initial state) could lead to an infinite loop.

• comment by Anton — Saturday, 2015 September 12, 20:05

The code uses nautical metaphors, so I’m calling the [theta, kappa …] list rudder. Not gonna start with empty rudders as suggested above, but I have found a couple of cases where an incomplete rudder is appropriate:

The ends of the stroke, not having enough neighbors to define a three-point circle, initially have empty rudders.

When a proposed replacement arc violates the pixel rule — no, I don’t think I’ll explain that here.

• comment by Anton — Saturday, 2018 February 24, 16:55

This is no longer relevant in my current model.

Subscribe without commenting

RSS feed for comments on this post.