Hi, I need to paint the line which links two points.
I am doing it, in Java. I receive two points as parameters and I have to calculate if the straight line between them, is inside the black figure.
I developed my own solution using the straight line equation, but my results are different than using the "professional" programs (such as GIMP or even MS Paint).
Here is a example of what I want:
But my algorithm does this:
*The green point is out of the figure and this is not possible.
Any ideas? Anyone know which code is been using for this, in "professional" apps?
Thanks! Daniel.
EDIT: Images