I can't seem to find much on google on how to do this.
Given two sets of coordinates, what are the calculation to plot each pixel of a line?
Ex: I want to make a line go from (5,5) to (100,100)
So when x is 6, then y is going to be equal to 6 as well, this is an easy example because it's a diagonal line. But basically I'm trying to find y given a certain value of x.
I need to do this programaticaly and I'm pretty sure I recall learning this stuff in math in school, and I think it's actually the first time where I can actually apply one of those things to the real world... but it's been too long so I don't remember any of it anyway. :awe:
I figured I'd find a lot of this stuff on google but all I'm finding is calculators that want to do it for me and spit out the result. I need the actual formula.
Given two sets of coordinates, what are the calculation to plot each pixel of a line?
Ex: I want to make a line go from (5,5) to (100,100)
So when x is 6, then y is going to be equal to 6 as well, this is an easy example because it's a diagonal line. But basically I'm trying to find y given a certain value of x.
I need to do this programaticaly and I'm pretty sure I recall learning this stuff in math in school, and I think it's actually the first time where I can actually apply one of those things to the real world... but it's been too long so I don't remember any of it anyway. :awe:
I figured I'd find a lot of this stuff on google but all I'm finding is calculators that want to do it for me and spit out the result. I need the actual formula.
