>-----Original Message----- >From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] >On Behalf Of Lee Marshall >Sent: 22 July 2007 20:09 >To: piclist@mit.edu >Subject: [OT] Mathematics - line drawing > > > >hi, i want to work with graphic lcds, but i am unsure about >how to calculate what pixels are switched on when a line is drawn. > >i am guessing there is some algorithm for calculating what >pixels are turned on, if a line must be drawn from 0,3 to 4,6 >or something. > >can anyone tell me about this process... >-- Point Google to "Bresenham line algorithm" and you should have more information than you could ever need. e.g. http://en.wikipedia.org/wiki/Bresenham's_line_algorithm This is a simple algorithm that avoids any multiplication or division, so runs quickly on small micros. Bresenham also developed a circle drawing algorithm that might be useful to to you. Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist