{"id":142,"date":"2021-03-28T22:29:46","date_gmt":"2021-03-28T20:29:46","guid":{"rendered":"https:\/\/workerbase.org\/wordpress\/?p=142"},"modified":"2021-11-20T15:58:32","modified_gmt":"2021-11-20T14:58:32","slug":"racket-scheme-system","status":"publish","type":"post","link":"https:\/\/arkenidar.com\/wordpress\/2021\/03\/28\/racket-scheme-system\/","title":{"rendered":"Racket (Scheme system)"},"content":{"rendered":"\n<p>This is a rectangular area calculation given its 4 vertices&#8217; coordinates (axis-aligned). I had to do some research on various how-tos.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#lang racket\n(define rect1 '( (1 1) (5 1) (1 -2) (5 -2) ) )\n(define xmin 'undefined)\n(define xmax 'undefined)\n(define ymin 'undefined)\n(define ymax 'undefined)\n(define (bounds point) (begin\n   (void (let\n       ( (x (list-ref point 0))\n     (y (list-ref point 1)) )\n     (begin\n   (if (equal? xmin 'undefined) (set! xmin x) (if (&lt; x xmin) (set! xmin x) '()) )\n   (if (equal? xmax 'undefined) (set! xmax x) (if (&gt; x xmax) (set! xmax x) '()) )\n   (if (equal? ymin 'undefined) (set! ymin y) (if (&lt; y ymin) (set! ymin y) '()) )\n   (if (equal? ymax 'undefined) (set! ymax y) (if (&gt; y ymax) (set! ymax y) '()) )\n   )\n     \n   ) ) )\n   )\n(bounds (list-ref rect1 0))\n(bounds (list-ref rect1 1))\n(bounds (list-ref rect1 2))\n(bounds (list-ref rect1 3))\n(list xmin xmax ymin ymax)\n(- xmax xmin)\n(- ymax ymin)\n(* (- xmax xmin)\n(- ymax ymin) )<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Welcome to DrRacket, version 7.4 &#91;3m].\nLanguage: racket, with debugging; memory limit: 128 MB.\n'(1 5 -2 1)\n4\n3\n12\n&gt; <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a rectangular area calculation given its 4 vertices&#8217; coordinates (axis-aligned). I had to do some research on various how-tos.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/arkenidar.com\/wordpress\/wp-json\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arkenidar.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arkenidar.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arkenidar.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arkenidar.com\/wordpress\/wp-json\/wp\/v2\/comments?post=142"}],"version-history":[{"count":2,"href":"https:\/\/arkenidar.com\/wordpress\/wp-json\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":144,"href":"https:\/\/arkenidar.com\/wordpress\/wp-json\/wp\/v2\/posts\/142\/revisions\/144"}],"wp:attachment":[{"href":"https:\/\/arkenidar.com\/wordpress\/wp-json\/wp\/v2\/media?parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arkenidar.com\/wordpress\/wp-json\/wp\/v2\/categories?post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arkenidar.com\/wordpress\/wp-json\/wp\/v2\/tags?post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}