{"id":138,"date":"2009-03-13T00:30:45","date_gmt":"2009-03-13T08:30:45","guid":{"rendered":"http:\/\/sambaker.net\/neattools\/?p=138"},"modified":"2009-03-15T11:37:05","modified_gmt":"2009-03-15T19:37:05","slug":"i-love-points","status":"publish","type":"post","link":"https:\/\/sambaker.net\/neattools\/?p=138","title":{"rendered":"I love Points"},"content":{"rendered":"<p>I&#8217;d never really looked into the new Point class until tonight, and I must say, I love it. Just for the organizational aspect alone, rather than tracking individual x and y coordinates, but it has some other nice features, like interpolate, which will find a point between two points from 0% to 100%, so for instance:<\/p>\n<pre lang=\"Actionscript\">Point.interpolate(a, b, .5);<\/pre>\n<p>will get you the midpoint, x and y between points a and b.  Instead of having to plug in the formula, which isn&#8217;t difficult <img src=\"https:\/\/sambaker.net\/neattools\/wp-content\/plugins\/wpmathpub\/phpmathpublisher\/img\/math_984_7047f9cc81c41af646a609ae7cba0741.png\" style=\"vertical-align:-16px; display: inline-block ;\" alt=\"(x1+x2)\/2,(y1+y2)\/2\" title=\"(x1+x2)\/2,(y1+y2)\/2\"\/> but when you&#8217;ve got long expressions, long confusing expressions for each one, it adds up.<br \/>\nI went from something like this:<\/p>\n<pre lang=\"Actionscript\">_line.graphics.curveTo(m1.x + m1.mod.width + buffer, deltaY, (((m1.x + m1.mod.width + buffer) - (m2.x -buffer)) \/ 2) + m2.x -buffer,deltaY);<\/pre>\n<p>(You can&#8217;t see it but it&#8217;s shooting off the right side of the screen)<br \/>\nto this:<\/p>\n<pre lang=\"Actionscript\">_line.graphics.curveTo(c.x, c.y, cd.x, cd.y);<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;d never really looked into the new Point class until tonight, and I must say, I love it. Just for the organizational aspect alone, rather than tracking individual x and y coordinates, but it has some other nice features, like interpolate, which will find a point between two points from 0% to 100%, so for [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/posts\/138"}],"collection":[{"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=138"}],"version-history":[{"count":34,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/posts\/138\/revisions"}],"predecessor-version":[{"id":177,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/posts\/138\/revisions\/177"}],"wp:attachment":[{"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}