Click here to Skip to main content
15,914,452 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Costing terrain paths Pin
Kevnar9-Nov-06 4:13
Kevnar9-Nov-06 4:13 
QuestionBeginners question? Where does the exact double value go? Pin
ClockDivider8-Nov-06 6:48
ClockDivider8-Nov-06 6:48 
AnswerRe: Beginners question? Where does the exact double value go? Pin
Rob Graham8-Nov-06 7:09
Rob Graham8-Nov-06 7:09 
GeneralRe: Beginners question? Where does the exact double value go? Pin
Dan Neely8-Nov-06 7:24
Dan Neely8-Nov-06 7:24 
GeneralRe: Beginners question? Where does the exact double value go? Pin
ClockDivider8-Nov-06 8:15
ClockDivider8-Nov-06 8:15 
QuestionScaling - help me Pin
dharani7-Nov-06 0:06
dharani7-Nov-06 0:06 
AnswerRe: Scaling - help me Pin
Jörgen Sigvardsson7-Nov-06 13:02
Jörgen Sigvardsson7-Nov-06 13:02 
GeneralBresenhams algorithm for drawing lines Pin
Jörgen Sigvardsson6-Nov-06 12:59
Jörgen Sigvardsson6-Nov-06 12:59 
So, I've been studying Bresenhams algorithm for drawing lines. I understand how it works, mainly because I've executed the algorithm on paper. The algorithm is quite beautiful.

However, I fail to understand why it works. Well, I kind of sort of understand, but it's more of a gut feeling than anything else. I have a book titled "Computer Graphics: Principles and Practice, Second Edition in C". It states that a line can be desribed as
1) F(x, y) = a*x + b*y + c = 0
It also says
2) dy = y1 - y0
dx = x1 - x1
and goes on to state that the slope intercept form can be written as:
3) y = dy/dx * x + B
It then concludes that
4) F(x, y) = dy * x - dx * y + B * dx = 0


I understand how 1), 2), 3) and 4) fit together. What I don't understand is where 1) comes from. I don't think I've ever seen an equation describing a line that way. I am unsure what it represents. I *think* it represents all values of x and y which are on the line. Is this the case? My gut feeling tells me that F(x, y) is a union of sorts of the functions f(y) and g(x), each describing the line from both axis. I would appreciate it if someone could help me understand this mystery of mine, or give me pointers to where I can find out.


--
LOADING...

GeneralRe: Bresenhams algorithm for drawing lines Pin
Luc Pattyn6-Nov-06 13:43
sitebuilderLuc Pattyn6-Nov-06 13:43 
GeneralRe: Bresenhams algorithm for drawing lines Pin
Jörgen Sigvardsson6-Nov-06 14:03
Jörgen Sigvardsson6-Nov-06 14:03 
GeneralRe: Bresenhams algorithm for drawing lines Pin
Bassam Abdul-Baki6-Nov-06 13:45
professionalBassam Abdul-Baki6-Nov-06 13:45 
GeneralRe: Bresenhams algorithm for drawing lines Pin
Jörgen Sigvardsson6-Nov-06 14:09
Jörgen Sigvardsson6-Nov-06 14:09 
GeneralRe: Bresenhams algorithm for drawing lines Pin
Michael Dunn7-Nov-06 15:27
sitebuilderMichael Dunn7-Nov-06 15:27 
QuestionNearest neighbour algorithm Pin
Islam Khalil Saber6-Nov-06 4:33
Islam Khalil Saber6-Nov-06 4:33 
AnswerRe: Nearest neighbour algorithm Pin
ejuanpp6-Nov-06 4:54
ejuanpp6-Nov-06 4:54 
GeneralRe: Nearest neighbour algorithm Pin
Islam Khalil Saber6-Nov-06 13:13
Islam Khalil Saber6-Nov-06 13:13 
QuestionTravelling Salesman Problem Pin
and_reas5-Nov-06 23:11
and_reas5-Nov-06 23:11 
AnswerRe: Travelling Salesman Problem Pin
Just me at will_george...something6-Nov-06 6:01
Just me at will_george...something6-Nov-06 6:01 
GeneralRe: Travelling Salesman Problem Pin
Steve S7-Nov-06 1:03
Steve S7-Nov-06 1:03 
GeneralRe: Travelling Salesman Problem Pin
Just me at will_george...something8-Nov-06 2:22
Just me at will_george...something8-Nov-06 2:22 
AnswerRe: Travelling Salesman Problem Pin
mehata7-Nov-06 16:57
mehata7-Nov-06 16:57 
GeneralRe: Travelling Salesman Problem Pin
Just me at will_george...something8-Nov-06 2:12
Just me at will_george...something8-Nov-06 2:12 
QuestionRe: Travelling Salesman Problem Pin
DHIRAJ SHETI7-Dec-06 18:05
DHIRAJ SHETI7-Dec-06 18:05 
AnswerRe: Travelling Salesman Problem Pin
ednrgc6-Nov-06 6:18
ednrgc6-Nov-06 6:18 
AnswerCross poster not doing their own homework Pin
leckey6-Nov-06 6:45
leckey6-Nov-06 6:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.