Hi,
I know the distance formula is
d = Sqrt( ((x2 - x1) ^2) + ((y2 - y1) ^ 2))
If I have values for distance, and y2 and y1, how do I determine x2 and x1?
Printable View
Hi,
I know the distance formula is
d = Sqrt( ((x2 - x1) ^2) + ((y2 - y1) ^ 2))
If I have values for distance, and y2 and y1, how do I determine x2 and x1?
You just don“t. You have to have X1 or X2. At least one of these two values has to be known, otherwise X1 can be any value and X2 will be easily found (or interchange X1 and X2).
Rui
You don't have enough information to get x2 and x1. With the information provided, you can get x2 - x1, but that's it. You have a single equation with 2 unknowns ==> infinite number of solutions. You need a 2nd equation.
how to write a vbscript of distance formula
Your post title says "find 1 end point" but your problem statement is asking for the x coordinate of both points instead of the x and y coordinate of a single point. If you know one point's location and the distance, there are still an infinite number of answers, but instead they lie on a circle. Using the setup you've given, the points may lie on parallel (horizontal) lines.
Not sure if that's helpful, though maybe it is for terminology.
The only quantity that's unambiguously determined is the positive difference of the x coordinates,
|x2 - x1| = +Sqr[d2 - (y2 - y1)2]
where the vertical bars mean absolute value.
You can't even say whether x2 > x1 or x2 < x1