## November 22, 2006

### Line representation

What is the most sensible representation of a line? There are a few possibilities including:
• Two distinct points: (x1,y1) & (x2, y2)
• r = x cos(a) + y sin(a) : r = the perpendicular distance to the line. a = the angle r makes with the x-axis.

I suppose the actual operations I need to perform on lines should dictate the best represention to ease calculations. Using gradients gets tricky when dealing with vertical lines. Angles are preferable since they range between -Pi/2 and Pi/2.

The line following algorithm relies on calculating the intersection of lines. It produces start and end points of line segments. Therefore representing lines as two distinct points may be the best approach. Calculating the intersection of two lines represented this way is described here

You are not allowed to comment on this entry as it has restricted commenting permissions.

## Search this blog

• I scratched my eye while i was holding some kind of plastic packagi… by Ercan on this entry
• About a year ago my contacts that i was wearing, i guess were fautl… by Jon on this entry
• I got shower gel in my eye 4 and a half days ago, and becasue i rub… by Chris on this entry
• This website may help http://www.webmd.com/eye–health/tc/Eye–In… by S on this entry
• I somehow got dirt, or debris in my eye. The terrible pain sent me … by Bobbi on this entry

## November 2006

Mo Tu We Th Fr Sa Su
Oct |  Today  | Dec
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30