- #1
catalin.drago
- 10
- 0
Hello,
I have asked this question already but have not been able to get conclusive answer.
I have a problem and please let me know if my solution is correct.
I have a known point, at location A(x1,y1,z1) and the point B(x2,y2,z2) and I would like to find the coordinates of a third point C(x3,y3,z3) that is located on the line AB, and the distance AC is 1.2 times greater then AB.
So, my idea is to obtain the equation of the line formed by points A and B. The direction of AB is (x2-x1, y2-y1, z2-z1), so the equation of the line is:
x = x1-(x2-x1)*t;
y = y1-(y2-y1)*t;
z = z1-(z2-z1)*t;
Distance AB is sqrt( (x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2). KNOWN
Distance AC is sqrt( (x3-x1)^2 + (y3-y1)^2 + (z3-z1)^2). UNKNOWN
I can replace the x, y, z points determined for the line equation in the distance AC, and the result should be 1.2 times greater then the distance AB.
So, sqrt( (x1-(x2-x1)*t-x1)^2 + (y1-(y2-y1)*t-0)^2 + (z1-(z2-z1)*t-0)^2) = 1.2 * dist(AB).
I find t from here, solving the quadratic equation and I obtain the coordinates of the point by replacing the t in the equation of the line.
Is this correct?
Thank you for your time.
I have asked this question already but have not been able to get conclusive answer.
I have a problem and please let me know if my solution is correct.
I have a known point, at location A(x1,y1,z1) and the point B(x2,y2,z2) and I would like to find the coordinates of a third point C(x3,y3,z3) that is located on the line AB, and the distance AC is 1.2 times greater then AB.
So, my idea is to obtain the equation of the line formed by points A and B. The direction of AB is (x2-x1, y2-y1, z2-z1), so the equation of the line is:
x = x1-(x2-x1)*t;
y = y1-(y2-y1)*t;
z = z1-(z2-z1)*t;
Distance AB is sqrt( (x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2). KNOWN
Distance AC is sqrt( (x3-x1)^2 + (y3-y1)^2 + (z3-z1)^2). UNKNOWN
I can replace the x, y, z points determined for the line equation in the distance AC, and the result should be 1.2 times greater then the distance AB.
So, sqrt( (x1-(x2-x1)*t-x1)^2 + (y1-(y2-y1)*t-0)^2 + (z1-(z2-z1)*t-0)^2) = 1.2 * dist(AB).
I find t from here, solving the quadratic equation and I obtain the coordinates of the point by replacing the t in the equation of the line.
Is this correct?
Thank you for your time.