tag:blogger.com,1999:blog-9397972918839729292024-03-20T23:08:52.472+00:00Book Fragmentsd.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.comBlogger35125tag:blogger.com,1999:blog-939797291883972929.post-24439681823877906632009-12-02T12:32:00.002+00:002009-12-02T12:34:51.664+00:00Im back at workI've just been cleared to return to work. I Have almost finished the first edit, currently at 700 pages. Before my next operation in two months time I will do some more work to get the book into a shape that it can be sent to some publishers. This will involve a little restructuring and writing some of the missing chunks. I have another operation in Jan so I will be working flat out. I will answer all remaining emails tomorrow.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-1251705264983352092009-10-12T10:27:00.001+01:002009-10-12T10:27:43.761+01:00Progress Oct 10I have now reached Chunk 44, hope to get up to 50 by the weekend.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com1tag:blogger.com,1999:blog-939797291883972929.post-71045649587537354472009-10-01T09:46:00.002+01:002009-10-01T09:47:01.375+01:00I have started againI am now able to start some work on the project: edited chunk 38 yesterday (excellent)d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-20283034602793172422009-09-20T12:37:00.001+01:002009-09-20T12:39:08.884+01:00More on my eyeThings seem to be going well. I have another week off and then will return to the project. I have to have another operation sometime after three months; this will depend on how well the retina has adhered. Im feeling a lot better.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com3tag:blogger.com,1999:blog-939797291883972929.post-88498978964213069182009-09-01T08:56:00.001+01:002009-09-01T08:58:26.522+01:00My eyeI have had to go into hospital (the fantastic Radcliffe in Oxford) for an operation to put back my retina, part of which had been detached. This means no work for a fortnight. I will need a second op in December. I am hoping to catch up lost time in October when I shall be home on a sabbatical. Feeling very frustrated with an eye that feels it has been punched.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com2tag:blogger.com,1999:blog-939797291883972929.post-23104231853411765622009-08-25T09:12:00.001+01:002009-08-25T09:14:27.371+01:00Progress Aug25As many of you will know I have an eye problem and have had to stop for at least a fortnight. I have reached chunk 37 and, so far, the quality has been excellent. I have had very little editing to do. There will now be a hiatus but I will let you know when I return.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-6869846392050427312009-07-10T09:42:00.002+01:002009-07-10T09:54:33.564+01:00I'm backI have just returned from Malta and started editing again. Have reached chunk 25. Hope to get to 40ish by the end of the month. Do have a good holiday.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-25026769710720038692009-06-19T09:41:00.002+01:002009-06-19T09:44:00.812+01:00Progress 17th JuneI have reached Chunk 20 in the editing. I hope to complete the first full edit by the end of August and then carry out a structuring exercise which would involve adding some glue text to cover the interfaces between the chunks.<br /><br />It was an excellent event on Monday. Ira has offered to write a preface; something I have taken up with alacrity.<br /><br />If any of you want to be put on the reserve list for chunks that were not delivered please email me.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-6059273018845228092009-06-06T07:45:00.001+01:002009-06-06T07:47:43.089+01:00Webcast DetailsThe webcast page for the 15th June event is <a href="http://stadium.open.ac.uk/1355/">here</a>. It automatically refreshes itself, adding the Live links when the event goes live. You will need QuickTime 7 or later to view the webcast.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-32665349015666336662009-06-06T07:28:00.002+01:002009-06-06T07:34:35.196+01:00Progress 6th JuneSo far I have edited 13 texts. All are excellent. The main problems (all small) are:<br /><ul><li>Punctuation</li><li>Sometimes an over laid-back style</li><li>Two small assumptions about what students have learned in previous chunks were not correct.</li><li>Figure referencing needed fixing up.<br /></li></ul>I estimate that I have changed 3% of a chunk on average. I had hoped to get to 15 by tomorrow but family illness intervened. Hope to get to 18 by 13th June. The bulk of the editing will occur in July/August<br /><br />I may need to look at structure once I have done the first twenty. However, I will not be touching the texts that were delivered and edited, they are uniformly good.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-82811651893348668142009-06-01T19:08:00.002+01:002009-06-01T19:09:42.809+01:00June 15thWe are finalising the arrangements for the four hour session on the mass writing project. It will take place on June 15th. The first session will be from 11.00 to 13.00 and will be devoted to <span style="font-style: italic;">Processing</span>. Ira Greenberg will talk about his journey from artist to programmer and describe recent advances in <span style="font-style: italic;">Processing</span>.<br /><br />The afternoon will be started at 14.00 with a short talk by me introducing the project (about 30 minutes) and then four students will describe their involvement. We hope to finish by around 16.00. The event will be webcast so you can follow it live; however, it will also be recorded and made available for viewing later. Details of the webcast link and the link to the video will follow in about a week.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-86523237334238333222009-05-25T08:33:00.001+01:002009-05-25T08:35:02.423+01:00Progress 25/5/09Just to let you know that I have edited the first seven chunks. They have all been of the highest quality. Most of the changes have been cosmetic, for example adding semi-colons. Other changes have been done to get the book into a consistent style. I estimate that I have only deleted or modified about 3-4% of your texts so far. this is amazing!d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-84594963818036683322009-05-16T10:35:00.002+01:002009-05-16T10:45:08.510+01:00ProgressI have edited the first three chunks. I plan to do two more tomorrow. I suspect that my rate will be about five chunks a week until the summer when it should accelerate: I stay with my mum-in-law in an area of France which is, without a doubt, the most ill-served in terms of the attractions that I enjoy. So, apart from a two day wine buying trip to the Loire, I shall probably be up to 15 a week for a fortnight. Incidentally, if you are ever in Fontrevaud, just off the Loire, I recommend the Hotel Abbaye Royale in Fontrevaud; its cheap for what you get and having breakfast in the cloisters of an old nunnery is quite something. Advanced booking recommended. Also La Licorne is a stellar restaurant in Fontrevaud.<br /><br />So far the chunks I have edited have been fantastic. I calculate that in editing them I have only changed about 2-3% of the text which is amazing. When I have done I will put them on an ftp server.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-80376869939959345722009-05-16T10:26:00.002+01:002009-05-16T10:35:13.683+01:00Update June 15The arrangements for June 15 are now almost there. I will do a brief fifteen minute introduction. Ira will talk for two hours about <span style="font-style: italic;">Processing </span>and his journey from artist to computer programmer and four of you have bravely volunteered to give short 20 minute talks. I still have about five chunks of £50 pounds for expenses if anyone wants to join us on the 15th. As a minimum we hope to video the sessions. We are, however, hoping to webcast the four hours. Watch this space over the next few weeks; a webcast would also involve recording the four hours and putting it on a web site for download.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-34251680454573170102009-05-08T09:35:00.002+01:002009-05-08T09:38:58.039+01:00In June Meet Ira GreenbergIra Greenberg will be visiting the department in either June or early July. he will be giving a talk about <span style="font-style: italic;">Processing </span>and I will be giving a talk about this project. There may be some money around to pay travel expenses for some of you. I will know in a few days. Unfortunately, the talks will be on a weeekday so I am assuming most of you will be at work. However, watch this space if you want to come. It will be first come, first served for travel funds.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-6427837154608989862009-05-07T09:03:00.001+01:002009-05-07T09:03:29.394+01:00My role from SundayThanks to all of you who have submitted chunks so far. My part in the project starts on Sunday when I will start editing the first ten chunks. I intend putting the book up on a web site after each of the ten chunks has been completed. I will send you the URL in due course.<br /><br />I would estimate that editing the book and writing the small number of chunks that remain will take me up to the end of Aug. I will then get a version of the book printed using Lulu or some other company and will send you each a copy. I will, then try and interest a publisher such as OReilly in publishing it formally.<br /><br />I also intend developing an e-learning course based on your material which will be put on the OU Open Learn site.<br /><br />So, watch this space. If you are interested in doing a second chunk please let me know.<br /><br />Darreld.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-8339871120367944202009-04-27T14:43:00.001+01:002009-04-27T14:44:12.816+01:00Deadline loomingThe end of month deadline is looming. I would be grateful if you could get your chunks in to me by 7th May.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-90148772849802221402009-03-10T19:32:00.001+00:002009-03-10T19:33:24.649+00:00URGENTThere are still some writers who have not nominated a chunk and/or sent me their blog address. Could you send me these as soon as possibled.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com1tag:blogger.com,1999:blog-939797291883972929.post-46773599781234057382009-02-10T08:18:00.001+00:002009-02-10T08:20:04.964+00:00ProgressThe first of the chunks are starting to come in. Don't panic though, the deadline is the end of April. However,if you have not chosen a chunk could you do so by Feb 27th. When that is cleared I can see how many spare chunks there are if anyone wants to write a second one.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-20072724044076872102009-01-11T10:54:00.003+00:002009-01-11T11:01:29.000+00:00Post holiday newsI'm now back monitoring mail regularly. It looks like all the book supply problems are over. Also, many thanks for those of you that sent sample programs, they all look good. I am planning to post some photos of the launch of our video screen in early February.<br /><br />An interesting new book on <span style="font-style: italic;">Processing </span>authored by Daniel Shiffman has just been published. Its very technical but excellent. The URL is below. I can also recommend Ben Fry's book on visualising data that uses <span style="font-style: italic;">Processing</span>, again the URL is below.<br /><br />Can you post your blog details and chunk choices to me by the end of January.<br /><br />Hope you all had a good holiday and I wish you all the best of years.<br /><br /><a href="http://www.amazon.co.uk/Visualizing-Data-Explaining-Processing-Environment/dp/0596514557/ref=sr_1_1?ie=UTF8&s=books&qid=1231671547&sr=1-1">The visualising data book</a><br /><br />The <a href="http://www.amazon.co.uk/Learning-Processing-Beginners-Programming-Interaction/dp/0123736021/ref=sr_1_1?ie=UTF8&s=books&qid=1231671607&sr=1-1">new <span style="font-style: italic;">Processing </span>book</a> by Shiffman.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-63171535163384724882008-10-31T11:04:00.039+00:002009-03-31T13:44:11.636+01:00List of blogs<span style="font-style: italic;">Updated <span style="text-decoration: underline;">Feb 18th</span><span style="text-decoration: underline;"></span></span><br /><a href="http://massprocessing.blogspot.com/">Anton Dil</a><br /><a href="http://masswriting-pixels.blogspot.com/">David Phillips</a><br /><a href="http://asfprocessing.blogspot.com/">Anthony Fiore</a><br /><a href="http://richardmasswriting.blogspot.com/">Richard Brown</a><br /><a href="http://neilmasswriting.blogspot.com/">Neil Singh</a><br /><a href="http://neilkeskar.blogspot.com/">Neil Keskar</a><br /><a href="http://rjsmasswriting.blogspot.com/">Rob Spain</a><br /><a href="http://lazydog-bookfragments.blogspot.com/">Ben Notarianni</a><br /><a href="http://martinpblogformasswritingproject.blogspot.com/">Martin Prout</a><br /><a href="http://javastewart.blogspot.com/">Stewart Edwards</a><br /><a href="http://learning-processing.blogspot.com/">Mike Taperell</a><br /><a href="http://writinginbytes.blogspot.com/">Sharon Dawes</a><br /><a href="http://affinetransformation.blogspot.com/">John Wilson</a><br /><a href="http://paulfr.blogspot.com/">Paul Richards</a><br />Antony Lees <a href="http://masswritingchunk82.blogspot.com/">Chunk 82 blog</a> <a href="http://masswritingchunk13.blogspot.com/">Chunk 13 blog</a><br /><a href="http://rwoublog.blogspot.com/">Rosie Wood</a><br /><a href="http://processingbits.blogspot.com/">Mike Richards</a><br /><a href="http://ubiquity-notebook.blogspot.com/">Sheep Dalton</a><br /><a href="http://bookfragments.blogspot.com/">Darrel Ince</a><br /><a href="http://iansbookfragment.blogspot.com/">Ian Perkins<br /></a><a href="http://philomathblog.blogspot.com/">Davide Rizzo</a><br /><a href="http://maxx-linx.blogspot.com/">Maxemilian Hilbrand</a><br /><a href="http://jgmw.blogspot.com/">James Gray</a><br /><a href="http://dbmasswriting.blogspot.com/">Darragh Buffini</a><br /><a href="http://barrymasswriting.blogspot.com/">Barry Martin</a><br /><a href="http://dpleated.blogspot.com/">Liam Madden</a><br /><a href="http://www.blogger.com/neilpetrie.blogspot.com">Neil Petrie</a><br /><a href="http://grant-grants.blogspot.com/">Grant Mankee</a><br /><a href="http://www.blogger.com/twisterbac.blogspot.com">Bryan Clifton</a><br /><a href="http://gir6.blogspot.com/">Geoff Riley</a><br /><a href="http://iamou.blogspot.com/">Ian Macey</a><br /><a href="http://printmiles.blogspot.com/">Alex Harris</a><br /><a href="http://fokionmasswriting.blogspot.com/">Fokion Zervoudakis</a><br /><a href="http://edmasswriting.blogspot.com/">Edward Toovey</a><br /><a href="http://rtmasswriting.blogspot.com/">Rosellyne Thompson</a><br /><a href="http://jdba-mw-blog.blogspot.com/">Jeremy Annis</a><br /><a href="http://oumasswriting.blogspot.com/">Ian Welch</a><br /><a href="http://jssmasswriting.blogspot.com/">Jannetta Steyn</a><br /><a href="http://artisticjava.blogspot.com/">Roberto Vormittag</a><br /><a href="http://shaileshgokhale.blogspot.com/">Shailesh S. Gokhale</a><br /><a href="http://prettyoubits.blogspot.com/">Boyd Stratton</a><br /><a href="http://amadanart.blogspot.com/">Nigel Parker</a><br /><a href="http://brynsadler.blogspot.com/">Ian Bryn Sadler</a><br /><a href="http://processingfun.blogspot.com/">Paolo Greco</a><br /><a href="http://mjheap.blogspot.com/">Marshall Heap</a><br /><a href="http://banto-software.blogspot.com/">Antonio Bruno</a><br /><a href="http://countingflowersonthewall.blogspot.com/">Andrew Hancox</a><br /><a href="http://dusanlicer.blogspot.com/">Dusan Licer</a><br /><a href="http://mikeblamires.blogspot.com/">Mike Blamires</a><br /><a href="http://anabelaoumasswriting.blogspot.com/">Anabela Green</a><br /><a href="http://jeanlucsmasswritingblog.blogspot.com/">JeanLuc Brausch</a><br /><a href="http://www.ooouandi.blogspot.com/">Rob Martin</a><br /><a href="http://jblogger-javabook.blogspot.com/">Simon Perrins</a><br /><a href="http://ou-java-book.blogspot.com/">Mark Moran</a><br /><a href="http://www.pauldfisher.blogspot.com/">Paul Fisher</a><br /><a href="http://rebeccamasswriting.blogspot.com/">Rebecca Ewen</a><br /><a href="http://mctchrisd.blogspot.com/">Christopher Douce</a><br /><a href="http://masswriting.witchguard.com/">Bruce Lawley</a><br /><a href="http://masswritingproject.blogspot.com/">Samir Rabab</a><br /><a href="http://myblog-project.blogspot.com/">Ebtessam Adam</a><br /><a href="http://sheepmasswritting1.blogspot.com/">Sheep Dalton</a><br /><a href="http://grahamhallsblog.blogspot.com/">Graham Hall</a><br /><a href="http://abilitystuff.blogspot.com/">Pat Jacobs</a><br /><a href="http://masswriting-chunk52.blogspot.com/">Mark Miller</a>d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-30596252220995284432008-10-28T12:01:00.038+00:002008-10-30T07:25:01.771+00:00Book Fragment 24<span style=";font-family:times new roman;font-size:130%;" >I have joined the writing team and have written fragment 24. It is reproduced below. It shows the general style that I would like you to aim at. I hope to do no more writing. There are some points to be made about the fragments themselves and which are illustrated in the text below:<br /></span><ul><li>Try and use a bit of white space in your programs indentation etc.</li><li>Use 'we' in the text. After all there are a large number of authors.</li><li>Always try and back reference or forward reference bits of the book as in 'you will remember in page xx'; don't worry about page numbers I will fix them up when I edit the text.</li><li>There's no harm in repeating a bit of program code.</li></ul>There are some specific points to be made about the painful process of transferring your text to <span style="font-style: italic;">Blogger</span>:<br /><ul><li>First its quite a painful process transferring from MS Word, be warned.</li><li>Second, figures are quite tricky to get into Blogger. When they are inserted they tend to be put into the top of your blog and you will then need to cut and paste.</li><li>When you add a picture to your blog use the left option.</li><li>There are only a few graphic formats that Blogger accepts; they are: jpg, gif, bmp and png.</li><li>Indentation is a pain. As you will see in my entry I gave up indenting the Java programs. If anyone has a simple solution please let me know.</li><li>Another pain is symbols such as 'less than' or 'greater than'. The best thing to do is to insert the HTML versions of the symbols. <a href="http://www.degraeve.com/reference/specialcharacters.php">Click here</a> for a list. <span style="font-style: italic;">Blogger </span>will not process your blog if you have less than, greater than etc symbols in it.<br /></li></ul><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><b style="">Geometry and computer art<o:p></o:p></b></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">So far in this book we have concentrated on a number of introductory ideas, mainly concerned with programming. We are now going to change tack and look at some mathematics, although we will present some programs later. In order to develop interesting and sophisticated computer art you need to know a bit about geometry. In this and the next two sections we will give you something of a primer. You will also need to know a little about algebra to understand the text up to page xx. The good news is that there is not a lot of it.</span></p><p class="MsoNormal" style="font-family:times new roman;"> </p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><b style=""><span style="">Dimensions<o:p></o:p></span></b></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">In mathematics we talk about dimensions. Normally we talk about one-dimensional, two -nsional and three-dimensional figures. A point is one-dimensional and a line is two-dimensional. A point represents a location in space. <o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">Figure 1 shows what we mean by a point and how we can uniquely identify individual points.</span></p><p class="MsoNormal" style="font-family:times new roman;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikXWMCT4GWuOFPES1E4234aqBHSQEvYwQNQn-cgM8Ur2s8PXocMgqY4H6fCvBV1WKRLC2kLLteULiKcCO5bewO7PpX_VsKd0qVxIJSpNwA64JJpVgTcugPN4J9bCLiLyboRqeAXU4ua9vk/s1600-h/F1.gif"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 280px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikXWMCT4GWuOFPES1E4234aqBHSQEvYwQNQn-cgM8Ur2s8PXocMgqY4H6fCvBV1WKRLC2kLLteULiKcCO5bewO7PpX_VsKd0qVxIJSpNwA64JJpVgTcugPN4J9bCLiLyboRqeAXU4ua9vk/s320/F1.gif" alt="" id="BLOGGER_PHOTO_ID_5262184247704593554" border="0" /></a></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikXWMCT4GWuOFPES1E4234aqBHSQEvYwQNQn-cgM8Ur2s8PXocMgqY4H6fCvBV1WKRLC2kLLteULiKcCO5bewO7PpX_VsKd0qVxIJSpNwA64JJpVgTcugPN4J9bCLiLyboRqeAXU4ua9vk/s1600-h/F1.gif"><br /></a></p><p class="MsoNormal" style="font-family:times new roman;"> </p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><span style="color: rgb(102, 102, 102);"> Figure 1</span>: Two points and how to identify them<br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">Imagine what you see is a very small computer screen which contains 49 pixels (7 by 7). If you are unsure about what a pixel is then have a look at page x. The screen is delineated by a pair of vertical lines and a pair of horizontal lines. The horizontal line at the bottom is known as the <i style="">x</i>-axis and the horizontal line at the leftmost position is known as the <i style="">y</i>-axis. <o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">Each of the axes contain whole number that represent the position of a point on the screen; for example the point (3,5) is shown. This represents a position of 3 along the <span style="font-style: italic;">x</span>-axis and a position of 5 along the <span style="font-style: italic;">y</span>-axis. Similarly the point (2,3) represents the point which has a position of 2 along the x-axis and a position 3 along the <span style="font-style: italic;">y</span>-axis. The key point to make here is that the coordinates uniquely fix the pixels in space and specify where they are. <o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">In reality a computer screen and other digital devices will have hundreds of pixels, for example a HD video camera has 11 mega (million) pixels.<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">So these are points, what then are lines and how are they specified? Clearly a line cannot be specified by an <i style="">x</i>-coordinate and a <i style="">y</i>-coordinate. Look at Figure 2. This shows a line in the same coordinate system that was </span><span style="font-size:100%;">used in Figure 1.</span></p><p style="text-align: left;" class="MsoNormal" face="times new roman"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRU4ORlm5ydfbrdE_K_lBeXTUDW0MZ8i_sWlAGfc8UxicSSbng6uTCuA8gq7Ou9AZpRb4-7_-GRnD8TKXCbqQocri-zi3WRYXML6i3uYsJPmHXRXZkw8oNhMGcLPxt2g62u1fEou2ariNR/s1600-h/F2.gif"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 238px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRU4ORlm5ydfbrdE_K_lBeXTUDW0MZ8i_sWlAGfc8UxicSSbng6uTCuA8gq7Ou9AZpRb4-7_-GRnD8TKXCbqQocri-zi3WRYXML6i3uYsJPmHXRXZkw8oNhMGcLPxt2g62u1fEou2ariNR/s320/F2.gif" alt="" id="BLOGGER_PHOTO_ID_5262186301610647970" border="0" /></a></p> <p class="MsoNormal" style="font-family:times new roman;"> </p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><span style="color: rgb(153, 153, 153);">Figure 2</span>: A line joining two coordinates<br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">Here we see a line that joins the coordinates (1,3) and (3,5). The two points specify the line. They show that it’s a short line and has two end points in that it does not continue on past the two end points. The line has an important property: its slope. This is the angle that it makes with the <i style="">x</i>-axis. In Figure 2 the angle is 45 degrees. <o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">So is there anything more we need to know about lines? The first thing is that a line can be infinite it can stretch infinitely from one coordinate to another. The line in Figure 2 is quite short. So how can we specify a line that is infinite (or at least is bounded by a computer screen)?<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"> </p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">We do this via an equation. The general form of the equation of a line is</span></p><div style="text-align: center;font-family:times new roman;"><span style="font-size:100%;"><span style="font-style: italic;">y</span> = <span style="font-style: italic;">mx</span>+<span style="font-style: italic;">c</span></span><span style="font-size:100%;"><br /></span></div><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><!--[if gte msEquation 12]><m:omathpara><m:omath><i style="'mso-bidi-font-style:normal'"><span style="'font-family:;font-size:12.0pt;"><m:r>y</m:r><m:r>=</m:r><m:r>mx</m:r><m:r>+</m:r><m:r>c</m:r></span></i></m:oMath></m:oMathPara><![endif]--><!--[if !msEquation]--><span style="font-size:100%;"><v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"> <v:f eqn="sum @0 1 0"> <v:f eqn="sum 0 0 @1"> <v:f eqn="prod @2 1 2"> <v:f eqn="prod @3 21600 pixelWidth"> <v:f eqn="prod @3 21600 pixelHeight"> <v:f eqn="sum @0 0 1"> <v:f eqn="prod @6 1 2"> <v:f eqn="prod @7 21600 pixelWidth"> <v:f eqn="sum @8 21600 0"> <v:f eqn="prod @7 21600 pixelHeight"> <v:f eqn="sum @10 21600 0"> </v:f> <v:path extrusionok="f" gradientshapeok="t" connecttype="rect"> <o:lock ext="edit" aspectratio="t"> </o:lock><v:shape id="_x0000_i1025" type="#_x0000_t75" style="width: 59.25pt; height: 14.25pt;"> <v:imagedata src="file:///C:%5CUsers%5Cdci2%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image001.png" title="" chromakey="white"> </v:imagedata></v:shape></v:path></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas></v:stroke></v:shapetype></span><!--[endif]--><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">Here <i style="">x</i> is the coordinate of the <i style="">x</i> axis, <i style="">y</i> is the coordinate of the <i style="">y</i> axis, <i style="">m</i> is the slope and <i style="">c</i> is the point in the <i style="">y</i> axis where the <i style="">x</i> coordinate is zero (we call it the intercept). Let’s see how that works with a longer line. Have a look at Figure 3. The value of <i style="">c</i> is 2; this where it the line intercepts the <i style="">y</i> axis. The slope is 45 degrees. However, the value of <i style="">m</i> is not 45, why is this? The answer is based on trigonometry and that <i style="">m</i> is the tan of the angle. However, you don’t need to know this so if you know nothing about trigonometry it is worth describing <i style="">m</i> in another way.</span></p><p class="MsoNormal" style="font-family:times new roman;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA6bgF2VZo9sAg_tijQX-b713XQTfJMJuTScheh5p87vg0_090SFKfM10qOPhr3tbXLTNZstJWwanGiMhOB7syJh9TmCgBhCStrTEEg8m5m1OF32kNeI0gHjTb0DUOwyz0-AiaslaiOaFE/s1600-h/F3.gif"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 238px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA6bgF2VZo9sAg_tijQX-b713XQTfJMJuTScheh5p87vg0_090SFKfM10qOPhr3tbXLTNZstJWwanGiMhOB7syJh9TmCgBhCStrTEEg8m5m1OF32kNeI0gHjTb0DUOwyz0-AiaslaiOaFE/s320/F3.gif" alt="" id="BLOGGER_PHOTO_ID_5262186832930059122" border="0" /></a></p><p class="MsoNormal" style="font-family:times new roman;"><br /><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><span style="color: rgb(153, 153, 153);">Figure 3</span>: An 'infinite' line<br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">This is that <i style="">m</i> is represents by the ratio of the difference of any two <i style="">x</i> points and the corresponding <i style="">y</i> points. For example, since the line goes through the points (0,2) and (2,4). the slope can be calculated as</span></p><div style="text-align: center;font-family:times new roman;"><span style="font-size:100%;">(4-2)/(2-0)=1<br /></span></div><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"> <o:p></o:p></span></p> <p class="MsoNormal" style="text-align: center;font-family:times new roman;" align="center"><span style="font-size:100%;"><v:shape id="_x0000_i1025" type="#_x0000_t75" style="width: 9pt; height: 15.75pt;" ole=""> <v:imagedata src="file:///C:%5CUsers%5Cdci2%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image002.wmz" title=""> </v:imagedata><!--[if gte mso 9]><xml> <o:oleobject type="Embed" progid="Equation.3" shapeid="_x0000_i1025" drawaspect="Content" objectid="_1286700842"> </o:OLEObject> </xml><![endif]--></v:shape></span><span style="font-size:100%;"><v:shape id="_x0000_i1026" type="#_x0000_t75" style="width: 51pt; height: 32.25pt;" ole=""> <v:imagedata src="file:///C:%5CUsers%5Cdci2%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image003.wmz" title=""> </v:imagedata><!--[if gte mso 9]><xml> <o:oleobject type="Embed" progid="Equation.3" shapeid="_x0000_i1026" drawaspect="Content" objectid="_1286700843"> </o:OLEObject> </xml><![endif]--></v:shape></span><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">this gives an equation of</span></p><div style="text-align: center;font-family:times new roman;"><span style="font-style: italic;font-size:100%;" >y</span><span style="font-size:100%;">=1</span><span style="font-style: italic;font-size:100%;" >x</span><span style="font-size:100%;">+2<br /></span></div><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><!--[if gte msEquation 12]><m:omathpara><m:omath><i style="'mso-bidi-font-style:normal'"><span style="'font-family:;font-size:12.0pt;"><m:r>y</m:r><m:r>=1</m:r><m:r>x</m:r><m:r>+2</m:r></span></i></m:oMath></m:oMathPara><![endif]--><!--[if !msEquation]--><span style="font-size:100%;"><v:shape id="_x0000_i1025" type="#_x0000_t75" style="width: 57pt; height: 14.25pt;"> <v:imagedata src="file:///C:%5CUsers%5Cdci2%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image004.png" title="" chromakey="white"> </v:imagedata></v:shape></span><!--[endif]--><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">remember that the intercept is 2; this can be easily simplified to</span></p><div style="text-align: center;font-family:times new roman;"><span style="font-style: italic;font-size:100%;" >y</span><span style="font-size:100%;">=</span><span style="font-style: italic;font-size:100%;" >x</span><span style="font-size:100%;">+2<br /></span></div><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><!--[if gte msEquation 12]><m:omathpara><m:omath><i style="'mso-bidi-font-style:normal'"><span style="'font-family:;font-size:12.0pt;"><m:r>y</m:r><m:r>=</m:r><m:r>x</m:r><m:r>+2</m:r></span></i></m:oMath></m:oMathPara><![endif]--><!--[if !msEquation]--><span style="font-size:100%;"><v:shape id="_x0000_i1025" type="#_x0000_t75" style="width: 50.25pt; height: 14.25pt;"> <v:imagedata src="file:///C:%5CUsers%5Cdci2%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image005.png" title="" chromakey="white"> </v:imagedata></v:shape></span><!--[endif]--><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">This is all you need to know about lines: that they can be expressed by a simple equation and the equation is defined in terms of a slope and a <i style="">y</i> intercept. The line relates <i style="">x</i> and <i style="">y</i>.<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">Once you have the equation of a line you can determine any point on it given an <i style="">x</i> value and a <i style="">y</i> value, for example in the line we have been looking at </span><!--[if gte msEquation 12]><m:omath><i style="'mso-bidi-font-style:normal'"><span style="'font-family:;font-size:12.0pt;"><m:r>y</m:r><m:r>=</m:r><m:r>x</m:r><m:r>+2</m:r></span></i></m:oMath><![endif]--><!--[if !msEquation]--><span style="font-size:100%;"><v:shape id="_x0000_i1025" type="#_x0000_t75" style="width: 50.25pt; height: 14.25pt;"> <v:imagedata src="file:///C:%5CUsers%5Cdci2%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image005.png" title="" chromakey="white"> </v:imagedata></v:shape></span><!--[endif]--><span style="font-size:100%;"><span style=""> </span>if the value of <span style="font-style: italic;">x</span> was 3 then the value of <span style="font-style: italic;">y </span>will be 5. <o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">It is worth looking at a simple program to illustrate some of the ideas here; I will then look at a more complicated program. Here I use the <i style="">Processing</i> function </span><span style="font-size:100%;">line</span><span style="font-size:100%;">. This takes four arguments: the first two are the <i style="">x</i> and <i style="">y</i> coordinates of a point and the third and fourth arguments are the <i style="">x</i> and <i style="">y</i> coordinates of a second point. The function draws a line between them. A simple program that uses the function is shown below:<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style=";font-family:courier new;font-size:85%;" >size(300,300);<o:p></o:p><br />background(255);<o:p></o:p></span><span style=";font-family:courier new;font-size:85%;" ><br /></span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;">line(25,40,280,90);</span></span><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">There are three statements here. The first sets up a window that is 300 by 300 pixels in size. The second statement sets the colour of the background to be white. The final statement draws a line from the point (25,40) to the point (280,90). The display from the program is shown as Figure 4.</span></p><p class="MsoNormal" style="font-family:times new roman;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPf1UpyPk6als3i5GCX126Hw2rq3FG4cOO3oPUwJsW4aDry3UsJ_izuMVLSo96xhU9T5dAff1sdg9SXDvnHmZpKd3KCR2PpinrexZn5o_b2E3RtoI9lG-RwwhypgYPBnYUP9Cs1C_mcOjd/s1600-h/Capture+1.JPG"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 300px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPf1UpyPk6als3i5GCX126Hw2rq3FG4cOO3oPUwJsW4aDry3UsJ_izuMVLSo96xhU9T5dAff1sdg9SXDvnHmZpKd3KCR2PpinrexZn5o_b2E3RtoI9lG-RwwhypgYPBnYUP9Cs1C_mcOjd/s320/Capture+1.JPG" alt="" id="BLOGGER_PHOTO_ID_5262187485076291474" border="0" /></a></p><p class="MsoNormal" style="font-family:times new roman;"><br /><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"> <span style="color: rgb(102, 102, 102);">Figure 4</span>: A line drawn by <span style="font-style: italic;">Processing</span><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">Have a look at the display and figure what is going on here. The line that has been drawn might be a surprise to you.</span></p><p class="MsoNormal" style="font-family:times new roman;"> </p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">The line looks wrong. It should start at (25,40) which should be at the bottom left-hand side of the window. You may remember that the answer to this conundrum is that Java has a coordinate system which is completely different to those in use in mathematics. The point (0,0) does not start at the bottom left-hand corner but at the top left-hand corner. If you look at Figure 4 you will see that the leftmost part of the line is 25 pixels across but 40 pixels <i style="">down</i> and the rightmost part of the line is 280 pixels across and 90 pixels <i style="">down</i>. Always bear this in mind when developing graphics programs in <i style="">Processing</i>.<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">Now that we have given you enough information about drawing lines it is about time that we showed you the development of a rather more complicated program. <o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">The program will draw a series of squares in different colours with the colour, the side of the square and the top leftmost coordinates being random.<span style=""> </span>The main steps in the program are as follows:</span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:85%;"><span style="font-family: courier new;">Set up the window with a size and background colour</span><br /><span style="font-family: courier new;">For a number of times</span><br /></span><span style="font-family: courier new;font-size:85%;" ><o:p></o:p></span><span style="font-size:85%;"><span style="font-family: courier new;">Randomly generate the length of a square</span><br /><span style="font-family: courier new;">Randomly generate a colour</span><br /><span style="font-family: courier new;">Randomly generate the top leftmost x and y coordinates</span><br /><span style="font-family: courier new;">Draw the square</span></span><br /></p><p class="MsoNormal" style="font-family:times new roman;"><o:p></o:p><span style="font-size:100%;">This is a simple design for the program. It leaves a number of questions open. The main one is how many squares will be generated? We shall assume that 20 will be generated. Rather than use the function </span><span style=";font-family:courier new;font-size:85%;" ><span style="">rect</span></span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span>that you met before on page xx we shall use line drawing instructions to generate the square. Another important question is what to do when an attempt is made to draw a square outside the drawing window? You will see a programmatic solution to this soon.<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">We will use a function </span><span style=";font-family:courier new;font-size:85%;" ><span style="">random</span></span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span>that generates a random number within a certain range. <o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">Our program is shown below<o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom: 0.0001pt;font-family:times new roman;"><span style="font-size:85%;"><span style=""><span style="font-family:courier new;">//Set up drawing window</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">size(400,400);</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">background(255);</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">strokeWeight(2);</span><o:p></o:p><span style="font-family:courier new;"><br /></span></span></span></p><p class="MsoNormal" style="margin-bottom: 0.0001pt;font-family:times new roman;"><span style="font-size:85%;"><span style=""><span style="font-family:courier new;">int noSquares = 20;</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">int xPosition, yPosition, squareLength;</span><o:p></o:p><br /></span></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style=";font-family:courier new;font-size:85%;" ><span style="">//Generate a series of random squares<o:p></o:p><br />for (int j=0;</span></span><span style=";font-family:courier new;font-size:85%;" >j</span><span style=";font-family:courier new;font-size:85%;" >‹</span><span style=";font-family:courier new;font-size:85%;" >noSquares;j++){</span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){><o:p></o:p><br /><span style=""> </span></nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>stroke(random(255), random(255), random(255));<o:p></o:p><br /><span style=""> </span></nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>xPosition = round(random(200));<o:p></o:p><br /><span style=""> </span></nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>yPosition = round(random(200));<o:p></o:p><br /><span style=""> </span></nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>squareLength = round(random(200));<o:p></o:p><br /><span style=""> </span></nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>line<o:p></o:p></nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>(xPosition,yPosition,xPosition+squareLength, yPosition);<o:p></o:p><br /><span style=""> </span></nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>line<o:p></o:p>(</nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>xPosition+squareLength,yPosition,xPosition+squareLength,</nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style="">yPosition+squareLength);</span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){> <o:p></o:p><br /><span style=""> </span></nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>line<o:p></o:p></nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>(xPosition+squareLength,yPosition+squareLength,xPosition,yPosition+squareLength);<o:p></o:p><br /><span style=""> </span></nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>line<o:p></o:p></nosquares;j++){></span></span><span style=";font-family:courier new;font-size:85%;" ><span style=""><nosquares;j++){>(xPosition, yPosition+squareLength,xPosition,yPosition);<o:p></o:p><br />}</nosquares;j++){></span></span><span style="font-size:100%;"><o:p></o:p></span></p><p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><o:p></o:p>The first chunk of code sets up the window as being 400 pixels by 400 pixels in length and height, sets the background colour to be white (255) and specifies that the width of any line drawn will be two pixels.<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;">size(400,400);</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">background(255);</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">strokeWeight(2);</span></span><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">The next part of the code just sets up some variables that are used to establish each square’s dimensions and position and define the number of squares that are to be drawn.<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><span style="">i<span style="font-size:85%;"><span style="font-family:courier new;">nt noSquares = 20;</span><o:p style="font-family: courier new;"></o:p></span></span><span style="font-size:85%;"><br /></span></span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;">int xPosition, yPosition, squareLength;</span></span><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">The heart of the program is the loop that iterates twenty times generating random numbers and drawing the squares.<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><span style="">/<span style="font-size:85%;"><span style="font-family:courier new;">/Generate a series of random squares</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">for (int j=0;j</span><nosquares;j++){ style="font-family: courier new;"><o:p></o:p><br /><span style=""> </span>stroke(random(255), random(255), random(255));<o:p></o:p><br /><span style=""> </span>xPosition = round(random(200));<o:p></o:p><br /><span style=""> </span>yPosition = round(random(200));<o:p></o:p><br /><span style=""> </span>squareLength = round(random(200));<o:p></o:p><br /><span style=""> </span>line<o:p></o:p>(xPosition,yPosition,xPosition+squareLength, yPosition);<o:p></o:p><br /><span style=""> </span>line<o:p></o:p>(xPosition+squareLength, yPosition,xPosition+squareLength, <o:p></o:p><br /><span style=""> </span>yPosition+squareLength);<o:p></o:p><br /><span style=""> </span>line<o:p></o:p>(xPosition+squareLength, yPosition+squareLength,xPosition, <o:p></o:p><br /><span style=""> </span>yPosition+squareLength);<o:p></o:p><br />line<o:p></o:p>(xPosition, yPosition+squareLength,xPosition,yPosition);<o:p></o:p></nosquares;j++){></span></span><span style="font-size:85%;"><br /></span></span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;">}</span></span><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">The function </span><span style=";font-family:courier new;font-size:85%;" ><span style="">stroke</span></span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span>sets up the colour of the lines that are to be drawn; it takes the red, green and blue components of the colour. Since these are generated randomly a value between (0,0,0) (black) to (255,255,255) (white) can be generated. You will remember that the argument within the </span><span style=";font-family:courier new;font-size:85%;" >random</span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span>function gives the range of the random number to be generated; <span style=""> </span>in our case this is 255; this means that a random number between 0 and 255 is capable of being generated. <o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">The next two lines determine the position of the top left-hand coordinates of the square. It is worth looking at these two statements in a little more detail. They are<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;">xPosition = round(random(200));</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">yPosition = round(random(200));</span></span><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">Here the function </span><span style=";font-family:courier new;font-size:85%;" >round</span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span>is used to convert (round up) the result of the </span><span style="font-size:100%;">random</span><span style="font-size:100%;"> function (a </span><span style="font-size:100%;">float</span><span style="font-size:100%;">) to an </span><span style=";font-family:courier new;font-size:85%;" >int</span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;">. </span></span>If the <span style="font-size:85%;"><span style="font-family:courier new;">round </span></span>function was not included then <i style="">Processing</i> would have indicated a syntax error. <o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">An interesting question that it might be worth your while stopping and thinking about is why I did not use the </span><span style="font-size:100%;">round</span><span style="font-size:100%;"> function within the code<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;">stroke(random(255), random(255), random(255));</span></span><o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">that sets up the colour of the lines used to draw the square? The answer is that inside the </span><span style="font-size:100%;">stroke</span><span style="font-size:100%;"> function you will almost certainly find the function </span><span style=";font-family:courier new;font-size:85%;" >round</span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span>being employed.<o:p></o:p></span></p> <p class="MsoNormal" style="font-family:times new roman;"><span style="font-size:100%;">The remainder of the code just displays the square using the randomly generated values for the length, <i style="">x</i> coordinate and <i style="">y</i> coordinate of each square. Notice that we have generated a length of no more than 200 and an <i style="">x </i>and <i style="">y</i> coordinate of no more than 200. This ensures that when a square is drawn it is not drawn outside the window since the window as a length of 400 pixels and height of 400 pixels. The display from the program is shown in Figure 5.<span style=""> </span>It has a nice sixties feel to it.</span></p><p class="MsoNormal" face="times new roman"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOqdPAxIjvQomKgRnmeeDqGYx_BuM7VChaYeC72BqL3_VWjVoao9rgIMGsCzuS0pa3frv0hs4YuOgyziicL6WGUQZsVsy04WLiJ90hbQAdW4uojSC_2rgz4539UTBZQ09XQ7nPfgSmbJnF/s1600-h/Capture.JPG"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 305px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOqdPAxIjvQomKgRnmeeDqGYx_BuM7VChaYeC72BqL3_VWjVoao9rgIMGsCzuS0pa3frv0hs4YuOgyziicL6WGUQZsVsy04WLiJ90hbQAdW4uojSC_2rgz4539UTBZQ09XQ7nPfgSmbJnF/s320/Capture.JPG" alt="" id="BLOGGER_PHOTO_ID_5262189120228441490" border="0" /></a></p><br /><p class="MsoNormal" face="times new roman"><br /></p><br /><br /><p class="MsoNormal" style="font-family: times new roman;"> <span style="color: rgb(102, 102, 102);">Figure </span>5: The 20 squares drawn using <span style="font-style: italic;">Processing</span><br /></p><br /><p class="MsoNormal" face="times new roman"><br /></p><br /><p class="MsoNormal" face="times new roman"><br /></p><br /><br /><p class="MsoNormal" face="times new roman"><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" face="times new roman"><span style="font-size:100%;">It might now be worth modifying the program in some way. There are a number of simple modifications that you might like to try, for example varying the number of squares that are drawn or the thickness of the drawing lines. Another modification is to make it loop endlessly in animation mode. You remember this mode from page xx. Here the functions </span><span style=";font-family:courier new;font-size:85%;" >setup</span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span>and </span><span style=";font-family:courier new;font-size:85%;" >draw</span><span style="font-size:100%;"> are employed to produce a continually moving picture. The program is shown below<o:p></o:p></span></p> <p class="MsoNormal" style="font-family: courier new;"> </p> <p class="MsoNormal" style="margin-bottom: 0.0001pt;font-family:times new roman;"><span style="font-size:85%;"><span style="font-family:courier new;">void setup(){</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">//Set up drawing window</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">size(400,400);</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">background(255);</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">strokeWeight(2);</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">}</span><o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom: 0.0001pt;font-family:times new roman;"><span style="font-size:85%;"><o:p> </o:p></span></p> <p class="MsoNormal" style="margin-bottom: 0.0001pt;font-family:times new roman;"><span style="font-size:85%;"><span style="font-family:courier new;">int noSquares = 20;</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">int xPosition, yPosition, squareLength;</span><o:p></o:p></span></p> <p class="MsoNormal" face="times new roman"><span style="font-size:100%;">/<span style="font-size:85%;"><span style="font-family:courier new;">/Generate a series of random squares</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;">public void draw(){</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />stroke(random(255), random(255), random(255));</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />xPosition = round(random(200));</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />yPosition = round(random(200));</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />squareLength = round(random(200));</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />line</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"> (xPosition,yPosition,xPosition+squareLength, yPosition);</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />line</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"> (xPosition+squareLength, yPosition,xPosition+squareLength, </span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"> yPosition+squareLength);</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />line</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"> (xPosition+squareLength, yPosition+squareLength,xPosition, </span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"> yPosition+squareLength);</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />line</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"> (xPosition, yPosition+squareLength,xPosition,yPosition);</span><o:p style="font-family: courier new;"></o:p> </span><span style=";font-family:courier new;font-size:85%;" >}</span><o:p></o:p></span></p> <p class="MsoNormal" face="times new roman"><span style="font-size:100%;">Here the code that sets up the window is placed in the function </span><span style=";font-family:courier new;font-size:85%;" >setup</span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span>and the code that draws the squares is placed in the function </span><span style=";font-family:courier new;font-size:85%;" >draw</span><span style="font-size:100%;"><span style=";font-family:courier new;font-size:85%;" >.</span><span style=";font-family:courier new;font-size:85%;" > </span>There are two differences between this program and the first one. The first difference is, of course, the definition of the two functions </span><span style=";font-family:courier new;font-size:85%;" >setup</span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span>and </span><span style=";font-family:courier new;font-size:85%;" >draw</span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;">. </span></span>The second difference is that the </span><span style=";font-family:courier new;font-size:85%;" >for</span><span style="font-size:100%;"><span style="font-size:85%;"> </span>loop in the first program has not been replicated in the second program. The reason for this is that the function </span><span style=";font-family:courier new;font-size:85%;" >draw</span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span>continually loops around endlessly. A snapshot of the drawing window during the running of this program is shown in Figure 6.</span></p><p class="MsoNormal" face="times new roman"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_A4m5jVZS9pjdhMcfO_FeL2dgazwfaRB-MZOjKm1h6PS3rQv5-7kpa4S6WOZSUH2gNjvR2ciHlt94IeYVfJWUL4FElkSZMGrPW_kzgXcfDx2HxEztoNhtWJsHtzrECmL062sxXqKbnOt/s1600-h/Capture+4.JPG"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 305px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_A4m5jVZS9pjdhMcfO_FeL2dgazwfaRB-MZOjKm1h6PS3rQv5-7kpa4S6WOZSUH2gNjvR2ciHlt94IeYVfJWUL4FElkSZMGrPW_kzgXcfDx2HxEztoNhtWJsHtzrECmL062sxXqKbnOt/s320/Capture+4.JPG" alt="" id="BLOGGER_PHOTO_ID_5262190608175443314" border="0" /></a></p><p class="MsoNormal" face="times new roman"><br /><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" face="times new roman"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" face="times new roman"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" face="times new roman"><span style="font-size:100%;"><span style="color: rgb(102, 102, 102);">Figure 6</span>: The drawing program in animation mode<br /></span></p><p class="MsoNormal" face="times new roman"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" face="times new roman"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family: times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family: times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family: times new roman;"><span style="font-size:100%;"><br /></span></p><p class="MsoNormal" style="font-family: times new roman;"><span style="font-size:100%;"><br />To conclude we shall describe one further program. This program uses the line drawing facilities within <i style="">Processing</i> to produce an animation that involves the continual drawing of a series of random lines. Each line will have two sets of random end-points, a random colour and a random thickness or stroke. The program is shown below<o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom: 0.0001pt;font-family:times new roman;"><span style="font-size:85%;"><span style="font-family:courier new;">void setup(){</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">//set up a white window background and size 400x400</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">size(400,400);</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">background(255);</span><o:p style="font-family: courier new;"></o:p><br /><span style="font-family:courier new;">}</span><o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom: 0.0001pt;font-family:times new roman;"><span style="font-size:85%;"><o:p> </o:p></span></p> <p class="MsoNormal" style="margin-bottom: 0.0001pt;font-family:times new roman;"><span style="font-size:85%;"><span style="font-family:courier new;">int startX, finishX, startY, finishY, lineColour;</span><o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom: 0.0001pt;font-family:times new roman;"><span style="font-size:85%;"><o:p> </o:p></span></p> <p class="MsoNormal" style="font-family: times new roman;"><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;">void draw(){</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />//Draw a set of random lines</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />startX = round(random(400));</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />startY = round(random(400));</span><o:p style="font-family: courier new;"></o:p><span style="font-family:courier new;"><br />finishX = round(random(400));</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />finishY = round(random(400));</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />strokeWeight(random(10));</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />stroke(random(255),random(255),random(255));</span><o:p style="font-family: courier new;"></o:p> <span style="font-family:courier new;"><br />line(startX, startY,finishX, finishY);</span><o:p style="font-family: courier new;"></o:p> </span><span style=";font-family:courier new;font-size:85%;" ><br />}</span><o:p></o:p></span></p> <p class="MsoNormal" style="font-family: times new roman;"><span style="font-size:100%;">Here the functions </span><span style=";font-family:courier new;font-size:85%;" >setup</span><span style="font-size:100%;"><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span>and </span><span style=";font-family:courier new;font-size:85%;" >draw</span><span style="font-size:100%;"><span style=";font-family:courier new;font-size:85%;" > </span>are used again. The heart of the program is again in </span><span style=";font-family:courier new;font-size:85%;" >draw</span><span style="font-size:100%;"><span style=";font-family:courier new;font-size:85%;" >. </span>Here the endpoints of the lines are randomly generated (the maximum values are 400; this matches the size of the window) and then the width (stroke) of the line is set followed by a random value of colour for the line. Finally the line is drawn using the </span><span style="font-size:100%;">line</span><span style="font-size:100%;"> function. <o:p></o:p></span></p> <p class="MsoNormal" style="font-family: times new roman;"><span style="font-size:100%;">Figure 7 shows the output from this program during its running. It shows a wide range of colours and a series of line widths.</span></p><p class="MsoNormal" style="font-family: times new roman;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn5fgWqChRjVtKNyr8wfZiYvFDRPqAZlxYtZ4nr_7Kw5VxkaaTSiFRR-jfAjDbbO3FGjLv2uAcxjPWB5_kW3RSFKU1DGyNLOksvrc69QzXkKq_r13droVol_VZ3SnJaa8utm5lSC74um-L/s1600-h/LineDrawer.JPG"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 302px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn5fgWqChRjVtKNyr8wfZiYvFDRPqAZlxYtZ4nr_7Kw5VxkaaTSiFRR-jfAjDbbO3FGjLv2uAcxjPWB5_kW3RSFKU1DGyNLOksvrc69QzXkKq_r13droVol_VZ3SnJaa8utm5lSC74um-L/s320/LineDrawer.JPG" alt="" id="BLOGGER_PHOTO_ID_5262191593082950658" border="0" /></a></p><p class="MsoNormal" style="font-family: times new roman;"><br /><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" style="font-family: times new roman;"><span style="font-size:100%;"><br /></span><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal" style="font-family: times new roman;"><span style="font-size:100%;"><br /></span><span style="font-size:100%;"><o:p></o:p></span></p> <p class="MsoNormal"><span style="font-size:85%;"><span style="color: rgb(102, 102, 102);">Figure 7</span>: The line drawing program</span><br /><span style=""><span style="font-size:100%;"><span style="font-family:times new roman;"></span></span> <o:p></o:p></span></p>d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com4tag:blogger.com,1999:blog-939797291883972929.post-39330536383465336222008-10-28T09:55:00.002+00:002008-10-28T09:57:34.671+00:00Book AssignmentsThe first book assignments are up. You can find them in the September section of this blog. Could I stress that you don't need to make a bid for a chunk until, say Christmas, after you have read the book and decided what you are best suited for and would enjoy.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com0tag:blogger.com,1999:blog-939797291883972929.post-80330945265490429152008-10-15T09:52:00.000+01:002008-10-15T10:42:25.484+01:00WelcomeWelcome to a very unusual project. The links on the right-hand side are your main navigation aid to the book whose chunk you will be writing. In the September collection you will find all the details that you need. Good luck!!<br /><br />Darrel Inced.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com2tag:blogger.com,1999:blog-939797291883972929.post-44259661397007787292008-10-15T09:42:00.004+01:002008-12-15T20:06:44.430+00:00FAQs<span style="font-style: italic;">What programming standards and commenting standards should I use?</span> The same as in the Greenberg book.<br /><br /><span style="font-style: italic;">Do we have to use a style sheet?</span> No, just send in the text using your own style. We will use a style sheet of our own.<br /><br /><span style="font-style: italic;">Can I email you at any time?</span> Yes, if you have problems or any queries at any time then let me know. I will try and answer within two days. There will be times when I will be away from my computer; I shall, however, advertise them on my main blog. Only email me on<span style="text-decoration: underline;"> </span><a href="https://mcs.open.ac.uk/mail/src/compose.php?send_to=MCT-Mass-Writing%40open.ac.uk">MCT-Mass-Writing@open.ac.uk</a><br /><br /><span style="font-style: italic;">I live on mainline Europe I can't get to Waterstones; what do I do?</span> You let us know and we will ship the book to you by surface mail.<br /><br /><span style="font-style: italic;">I have found the Greenberg book at a cheaper price than Waterstones at another outlet. Can I buy it there?</span> The best thing to do is to buy it and then use your Waterstones voucher for yourself, for example by buying some Christmas presents.<br /><br /><span style="font-style: italic;">What is the target audience?</span> The target audience is readers who want to get involved in computer art but who have no programming expertise and little mathematics. Processing has two modes: procedural and OO. I would hope that we could get this sort of reader up to complicated procedural programs.<br /><br /><span style="font-style: italic;">You mention that one program should be used to illustrate my 2500 odd words, is this a hard and fast rule?</span> No, if you feel some shorter programs would do then please use them. The choice is up to you.<br /><br /><span style="font-style: italic;">If I use diagrams what graphics format do I use?</span> Any format that can be embedded within your word processor text. Don't forget to send the graphics separately in the zip file that you send us when you have completed your part of the book.<br /><br /><span style="font-style: italic;">You say that you want a 100 line program to illustrate each chunk. What if I'm writing a chunk right at the beginning of the book and there's little scope for a large program?</span> The best thing is to develop a collection of small programs and describe each one. Try and make them as visual as possible.<br /><br /><span style="font-style: italic;">Can I write more than one chunk?</span> We are hoping to get 85 volunteers. This is very ambitious so contact us in November/December if you have enjoyed writing your 2500 words and want to do more.<br /><br /><span style="font-style: italic;">Do I get paid?</span> Unfortunately not; you do get the book that you will work from and a presentation copy of the book that you helped write. Look on the project as a way of donating some time to the OU, rather than money.<br /><br /><span style="font-style: italic;">Can I use text and diagrams from the Processing book that you give us?</span> Definitely not this would give rise to all sorts of copyright problems. Don't even devise computer programs that look like the ones that are described in the book.<br /><br /><span style="font-style: italic;">How do I insert diagrams into my blog?</span> Diagrams are important and most of you will need to employ them. Use any graphics program you like as long as the end-product can be embedded within the text from the word processor that you use.<br /><br /><span style="font-style: italic;">Does my English writing have to be perfect?</span> No, as long as it is readable and understandable then it will do. All the contributions will be edited. However, don't use this fact to write sloppily and assume that someone will rescue you.<br /><br /><span style="font-style: italic;">How long should I take over this task?</span> Its up to you: some of you will have good writing experience and have used Java for a long time, so the task may take a few weeks. Some of you, however, may struggle a bit with writing and need longer and might even deliver just short of the deadline.<br /><br /><span style="font-style: italic;">You ask us to load each version of the text into our blog, do you mean the first 500 words, then the first 1000 words etc?</span> This is one option; another option would be to write an outline of your part of the book and each version would refine it. If you feel you can do this then it might be the better option as it will give others a good idea of what your text is all about.<br /><br /><span style="font-style: italic;">How do you want us to post each version of the text?</span> You can either do it by just having one post and continually editing it showing each version or by creating a post for each version. It is up to you. The first way will result in less text.<br /><br /><span style="font-style: italic;">Can I look at other blogs? </span>Yes you should. There are a number of reasons for this. First, it might give you ideas about what you write. Second, it would enable you to check that there is no major overlap with your material and others material. Third, it would enable you to comment on other blogs and help other writers.d.c.incehttp://www.blogger.com/profile/17138852430931498108noreply@blogger.com2