I’m trying to figure out how to do this. Essentially I have points A and B which I know the location of. I then have point C and point D which I only know the coordinates of C. I know the length of C-D and know that C-D must be parallel to A-B. How could I generally solve for D given A,B,C and length of C-D.
Share
D = C ± (B-A) / |B-A| * |C-D|
If B=A there is no solution as the line AB degenerates to a point and parallelety of a line to a point is not defined.
Explanation
(B-A) / |B-A| is a direction vector of unit length. Multiplication by the length |C-D| results in the proper offset vector.
Edits: changed + to ± to provide both solutions. Added trivial case B=A.