Skip to content
Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

And it was done

elbeno, 1 March, 2008

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
(defun make-ellipse-sampler (center xradius yradius)
  (lambda (k)
    (let ((x (* xradius (cos k)))
          (y (* yradius (sin k))))
      (make-point (+ x (xcoord center)) (+ y (ycoord center))))))

Equal angle increments:

ellipse-by-angle

Equal circumferential distances:

ellipse-by-circumference

Lisp Maths Programming

Post navigation

Previous post
Next post

Related Posts

A bit of Pythagoras

15 March, 200815 March, 2008

Given Pythagorean triples that satisfy the Diophantine equation: a² + b² = c² where a, b and c share no common factors, one of a and b must be odd, the other must be even, and c is always odd. First, note that squares of even numbers are always divisible…

Read More

Functional Rainbow

29 December, 200829 December, 2008
Read More

RotateAVI v0.91beta

8 January, 200729 July, 2007

It’s up on elbeno.com. If you got a digital camera for Xmas (or otherwise), check it out. An easy way to rotate avi movies.

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

©2026 Why is a raven like a writing desk? | WordPress Theme by SuperbThemes