{"id":15361,"date":"2015-06-12T05:01:20","date_gmt":"2015-06-11T19:01:20","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=15361"},"modified":"2015-06-12T06:34:47","modified_gmt":"2015-06-11T20:34:47","slug":"php-and-javascript-and-css-shape-drawing-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-and-javascript-and-css-shape-drawing-tutorial\/","title":{"rendered":"PHP and Javascript and CSS Shape Drawing Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ShapeDraw\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP and Javascript and CSS Shape Drawing Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ShapeDraw\/ShapeDraw.jpg\" title=\"PHP and Javascript and CSS Shape Drawing Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">PHP and Javascript and CSS Shape Drawing Tutorial<\/p><\/div>\n<p>It is no coincidence that Geometry and Land Surveying have a lot in common.  When there are only small distances we talk about Plane Geometry because the curvature of the earth doesn&#8217;t come into the equation.  When Earth curvature matters, over longer distances, in Land Surveying the term <a target=_blank href='http:\/\/civilengineersforum.com\/geodetic-surveying\/'>Geodetic Surveying<\/a> is often used.  Here, the equations used need to model the Earth as close as possible to known measurements.<\/p>\n<p>So today, with our Plane Geometry web application, we start with our previous Survey Traverse web application, and add to its functionality with ability for it to fill out more for the user to describe a regular polygon of their choosing, defined by &#8230;<\/p>\n<ol>\n<li>number of polygon sides<\/li>\n<li>length of each polygon side<\/li>\n<\/ol>\n<p>We also add to the Google Charts Line Graph of the Drawn Shape a popup window showing the polygon as an HTML <a target=_blank title='HTML svg information from w3schools' href='http:\/\/www.w3schools.com\/svg\/'>svg<\/a> element.  Part of the reason for this is that the Google Chart Line Graph can exaggerate the x or y co-ordinate of its plots, but with the HTML svg element, you avoid this issue, as we are just showing you a &#8220;relative&#8221; view of the shape (ie. as distinct from an &#8220;absolute&#8221; view with distinct co-ordinates).<\/p>\n<p>The thinking here started with a look at New Century Maths stages 5.2\/5.3 &#8220;Exterior angle sum of a convex polygon&#8221;.  Did you know?<\/p>\n<blockquote><p>\nThe sum of the exterior angles of a convex polygon is 360\u00b0.\n<\/p><\/blockquote>\n<p>What we found to be the case, practically speaking, to imagine the drawing of a regular even-sided convex polygon (with &#8220;numsides&#8221; sides) was &#8230;<\/p>\n<ul>\n<li>look north &#8230;<\/li>\n<li>turn clockwise (360\u00b0 \/ numsides) for first line to draw (NB. there is more symmetry if this number is then divided by 2) &#8230; then from then on &#8230;<\/li>\n<li>off this previous line, turn clockwise (180\u00b0 +  (360\u00b0 \/ numsides)) for subsequent lines<\/li>\n<\/ul>\n<p>Link to Shape Draw live run (with Google Line Chart and HTML svg functionality) <a target=_blank title='Shape Draw live run with Google Line Chart and HTML svg' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ShapeDraw\/ShapeDraw.php'>here<\/a>.<br \/>\nLink to Shape Draw PHP source code <a target=_blank title='ShapeDraw.php' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ShapeDraw\/ShapeDraw.php-GETME'>ShapeDraw.php<\/a> with changes from code below as per <a target=_blank title='ShapeDraw.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ShapeDraw\/ShapeDraw.php-GETME'>this link<\/a>.<\/p>\n<p>Hope you enjoy the geometry ideas, and will leave you with a very useful link that helped with the Convex Polygon method to calculate the Surface Area <a target=_blank href='http:\/\/www.mathsisfun.com\/geometry\/area-irregular-polygons.html' link='Useful link for surface area'>here<\/a>.<\/p>\n<hr>\n<p id=\"hajcstt\">Previous relevant <a target=_blank title='HTML and Javascript and CSS Survey Traverse Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html-and-javascript-and-css-survey-traverse-tutorial\/'>HTML and Javascript and CSS Survey Traverse Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML and Javascript and CSS Survey Traverse Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.jpg\" title=\"HTML and Javascript and CSS Survey Traverse Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">HTML and Javascript and CSS Survey Traverse Tutorial<\/p><\/div>\n<p>Here is a tutorial showing some client-side basics in HTML and Javascript and CSS all in the one HTML file, to simplify concepts.   The tutorial subject matter is a webpage to perform Survey Traverse calculations.   A Survey Traverse is:<\/p>\n<blockquote><p>Traverse is a method in the field of surveying to establish control networks.[1] It is also used in geodesy. Traverse networks involve placing survey stations along a line or path of travel, and then using the previously surveyed points as a base for observing the next point. Traverse networks have many advantages, including:<\/p>\n<p>    Less reconnaissance and organization needed;<br \/>\n    While in other systems, which may require the survey to be performed along a rigid polygon shape, the traverse can change to any shape and thus can accommodate a great deal of different terrains;<br \/>\n    Only a few observations need to be taken at each station, whereas in other survey networks a great deal of angular and linear observations need to be made and considered;<br \/>\n    Traverse networks are free of the strength of figure considerations that happen in triangular systems;<br \/>\n    Scale error does not add up as the traverse is performed. Azimuth swing errors can also be reduced by increasing the distance between stations.<\/p>\n<p>The traverse is more accurate than triangulateration[2] (a combined function of the triangulation and trilateration practice).[3]<\/p><\/blockquote>\n<p>Let&#8217;s see some simple <a target=_blank title='click picture' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/'>HTML<\/a> in action in a tutorial &#8230;<\/p>\n<p>Link to HTML &#8220;spiritual home&#8221; &#8230; <a target=_blank title='W3Schools' href='http:\/\/www.w3schools.com\/html\/'>at W3Schools<\/a> has many tutorials.<br \/>\nLink to Survey Traverse live run &#8230; <a target=_blank title='Survey Traverse live run' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html'>here<\/a>.<br \/>\nLink to Survey Traverse live run (additional Google Line Chart functionality)  <a target=_blank title='Survey Traverse live run with Google Line Chart' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.php'>here<\/a>.<br \/>\nLink to Survey Traverse information &#8230; <a target=_blank title='Survey Traverse information' href='http:\/\/en.wikipedia.org\/wiki\/Traverse_(surveying)'>from Wikipedia from which quote above comes<\/a>.<br \/>\nLink to some downloadable HTML code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html_GETME' title='Download me'>SurveyTraverse.html<\/a> which packages up a lot of Javascript and a little bit of CSS &#8230; or JaCvasScriptS &#8230; not sure whether this would ever catch on.<br \/>\nLink to some downloadable PHP programming code (additional Google Line Chart functionality) &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.php_GETME' title='Download me'>SurveyTraverse.php<\/a>\n<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d1271' onclick='var dv=document.getElementById(\"d1271\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?cat=59\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d1271' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d15361' onclick='var dv=document.getElementById(\"d15361\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=mathematics\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d15361' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>It is no coincidence that Geometry and Land Surveying have a lot in common. When there are only small distances we talk about Plane Geometry because the curvature of the earth doesn&#8217;t come into the equation. When Earth curvature matters, &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-and-javascript-and-css-shape-drawing-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,21,37],"tags":[1585,281,484,513,518,576,652,1584,752,932,962,997,1586,1226,1319],"class_list":["post-15361","post","type-post","status-publish","format-standard","hentry","category-elearning","category-land-surveying","category-tutorials","tag-convex-polygon","tag-css","tag-geometry","tag-google","tag-google-chart","tag-html","tag-javascript","tag-lang-surveying","tag-mathematics","tag-php","tag-polygon","tag-programming","tag-shape","tag-svg","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15361"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=15361"}],"version-history":[{"count":8,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15361\/revisions"}],"predecessor-version":[{"id":15373,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15361\/revisions\/15373"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=15361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=15361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=15361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}