-1
$\begingroup$

This question already has an answer here:

Please help me solve the given problem.

Find the pixel positions for the straight line joining P1 (10, 20) and P2 (18, 25)

$\endgroup$

marked as duplicate by DumpsterDoofus, Michael E2, Kuba, Öskå, Dr. belisarius Jan 21 '15 at 18:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ There are different ways to draw your line, but one interesting approach (Bresenham's algorithm) is explained nicely in this question. $\endgroup$ – dionys Jan 21 '15 at 6:55
  • $\begingroup$ see also: Shading squares crossed by a diagonal $\endgroup$ – kglr Jan 21 '15 at 7:02
  • $\begingroup$ Do you want a list of the discrete pixels needed to draw the line segment? $\endgroup$ – m_goldberg Jan 21 '15 at 8:22
0
$\begingroup$
a P1 + (1-a) P2 for 0 < a < 1.
$\endgroup$
  • $\begingroup$ Can you please elaborate it #David. $\endgroup$ – Kumar Jan 21 '15 at 6:19
  • $\begingroup$ I think the OP wants a list of the discrete pixels needed to draw the line segment. If I'm right, this doesn't quite do the job. $\endgroup$ – m_goldberg Jan 21 '15 at 8:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.