I have two points at the end of the line.I need to get the final coordinates of the translation of this line.The translation will be a parallel line, which is the distance d from the original line.here is an image of what i need:
So, I need a function through which I can transfer these two points and the distance and get two new coordinates in the returns.I was stuck with this problem for a while. Any help would be appreciated! Thanks you!
The new coordinates will be the resulting vector.
d, , , .
EDIT:
, , . , ..
, d, .
(x2-x1, y2-y1). .
(-(y2-y1),-(x2-x1)) = (y1-y2,x1-x2).
,
A = (y1-y2,x1-x2)/|(y1-y2,x1-x2)|
, d,
d
NewPoint = OldPoint + d * A