Solve Manhattan Dist. Equation for 2D Line AB, Point C

  • Thread starter Thread starter onako
  • Start date Start date
  • Tags Tags
    Line
onako
Messages
86
Reaction score
0
I've derived an equation to satisfy the following:
Given two points A and B in 2D and distance t, compute the point C such that C is on the line AB, and the distance from A to C is t. Here, Euclidean distances are assumed.
Now, I want something similar; the point C is constrained to lie on the line AB, but the desired distance t needs be Manhattan distance. The absolute value terms make problems for my calculations. Any help on how to derive this is welcome.
 
Physics news on Phys.org
To clarify some things: the manhattan distace is
<br /> d_{ac}=|x_c-x_a|+|y_c-y_a|<br />
and constraining point C to be on AB (the final solution should have on the line order of ABC or ACB)
<br /> y_c=y_a+\frac{y_b-y_a}{x_b-x_a}(x_c-x_a).<br />
Here, the absolute value is the problem. Without it, I get the following:
<br /> x_c = \frac{d_{ac}}{d_{ab}}(x_b-x_a)+x_a<br />,
where one expression I replace with the Manhattan distance between A and B. However, I'm not sure if this is correct.
Any help on this is highly appreciated.
 
Last edited:
Back
Top