And it was done

Since I already had the binary search and interpolation code, it was just a matter of writing different samplers for ellipses and Bézier curves. ;; make a sampler function for a bezier curve (defun make-bezier-sampler (p0 p1 p2 p3) (lambda (k) (decasteljau p0 p1 p2 p3 k))) ;; make a sampler function for an ellipse… Continue reading And it was done

More on ellipses

I think I will use the same method as I do for Bézier curves to step along the circumference. Another generalisation I had to make from the circle code is with respect to the normal. For a circle of radius r, centred on the origin, and parameterised by angle θ, a point on the circle… Continue reading More on ellipses

On ellipses

Having conquered equidistant spacing along a Bézier curve, my thoughts now turn to the same problem for an ellipse. I have solved the problem for a circle of course, which is a special case of an ellipse. One would think that going from a circle to an ellipse would be mathematically easy: it’s easy to… Continue reading On ellipses

Profiling with SBCL

My Bézier curve code was not optimal, so I decided to learn how to profile with SBCL. In particular, I was not yet doing a binary search of the sampled points, neither was I doing an interpolation to recover the parameter t. Finally, I was sampling the curve at a fixed high frequency (probably too… Continue reading Profiling with SBCL

Experimenting with (cubic) Bézier subdivision

As you know, a Bézier curve (here meaning specifically a cubic Bézier) is often used for drawing all kinds of things in vector graphics. It has the nice property that the endpoints and control points form a bounding box, and deCasteljau’s algorithm is a nice numerically stable way of evaluating the curve at a particular… Continue reading Experimenting with (cubic) Bézier subdivision

Sneak preview

This is a sneak peek at my current personal project. A bit of computerised heraldry. (“Sable a [ordinary] ermine.” Left to right, top to bottom: chief, fess, pale, cross, bend, bend sinister, chevron, saltire. Yeah, I know; charges on a bend should be bendwise. It’s a work in progress.)

Arc’s debut

(Seems like this is just about what’s happened) Paul Graham: Behold, Arc! (disclaimer: blah blah blah) Rest of the Lisp-speaking world: Dude, weren’t you working for like 5 years on this? Now you give us a wrapper on Scheme? PG: Look, I know it’s a bit pre-alpha, but give it a go! You might like… Continue reading Arc’s debut

Published
Categorized as Lisp

Lisping towards enlightenment

Me: a C/C++ programmer of 12 years (professionally), a Lisp dabbler (programmer is too strong a word to use here) of, let’s say ~3 months. I’ve done enough functional stuff to be comfortable with that side, but I haven’t (hadn’t) yet written a project big enough to get me used to Lisp syntax. The project:… Continue reading Lisping towards enlightenment