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

Clang/GCC weirdness

5 February, 201530 June, 2015

Consider the following code: #include #include using namespace std; // base template template struct what_type { void operator()() { cout

Read More

How to print anything in C++ (part 4)

2 February, 201530 June, 2015

Part 1 Part 2 Part 3 Part 4 Part 5 Postscript Callable things. There are several types: functions member functions std::functions bind expressions lambdas objects that support operator() (function objects) So, going back to my tag code, so far (with everything I’ve added) and including callable things, it will look…

Read More

The Camel Has Two Humps

6 June, 200729 July, 2007

I’ve just been reading an interesting paper on teaching programming. First, the data regarding rates of attrition on computing courses is startling. Between 30% and 60% of the total CS intake fails the very first programming course! The paper’s authors postulate 3 programming hurdles to be negotiated: sequencing and assignment…

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