Calculate a point along the line A-B at a given distance from A

前端 未结 6 1379
情歌与酒
情歌与酒 2020-11-29 08:54

I\'m going quite mad trying to calculate the point along the given line A-B, at a given distance from A, so that I can "draw" the line between two given points. It

6条回答
  •  既然无缘
    2020-11-29 09:20

    Try to remove 'magnitude' term in the parentheses both for X and for Y expressions:

    (int)(  ((double)a.X + vectorX * distance)  +  0.5  )
    

提交回复
热议问题