{"id":458,"date":"2008-03-01T14:14:00","date_gmt":"2008-03-01T22:14:00","guid":{"rendered":"http:\/\/www.elbeno.com\/blog\/?p=458"},"modified":"2008-03-01T14:14:00","modified_gmt":"2008-03-01T22:14:00","slug":"and-it-was-done","status":"publish","type":"post","link":"https:\/\/www.elbeno.com\/blog\/?p=458","title":{"rendered":"And it was done"},"content":{"rendered":"<p>Since I already had the binary search and interpolation code, it was just a matter of writing different samplers for ellipses and B\u00c3\u00a9zier curves.<\/p>\n<pre>\r\n;; make a sampler function for a bezier curve\r\n(defun make-bezier-sampler (p0 p1 p2 p3)\r\n  (lambda (k)\r\n    (decasteljau p0 p1 p2 p3 k)))\r\n\r\n;; make a sampler function for an ellipse\r\n(defun make-ellipse-sampler (center xradius yradius)\r\n  (lambda (k)\r\n    (let ((x (* xradius (cos k)))\r\n          (y (* yradius (sin k))))\r\n      (make-point (+ x (xcoord center)) (+ y (ycoord center))))))\r\n<\/pre>\n<p>Equal angle increments:<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/88319047@N00\/2302412955\/\" title=\"ellipse-by-angle by villagelinca, on Flickr\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/farm4.static.flickr.com\/3148\/2302412955_01a664e1fb.jpg\" width=\"500\" height=\"500\" alt=\"ellipse-by-angle\" \/><\/a><\/p>\n<p>Equal circumferential distances:<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/88319047@N00\/2302412953\/\" title=\"ellipse-by-circumference by villagelinca, on Flickr\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/farm4.static.flickr.com\/3021\/2302412953_f2b1aa88a8_o.png\" width=\"500\" height=\"500\" alt=\"ellipse-by-circumference\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since I already had the binary search and interpolation code, it was just a matter of writing different samplers for ellipses and B\u00c3\u00a9zier 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&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,11,8],"tags":[],"class_list":["post-458","post","type-post","status-publish","format-standard","hentry","category-lisp","category-maths","category-programming"],"_links":{"self":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=458"}],"version-history":[{"count":0,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/458\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}