How to find the third point at a given distance angle from a line segment in a plane? Suppose i have a plane and a line segment with end points (x_1,y_1),(x_2,y_2) is given to us.Now we need to find another point which lies at distance d from (x_2,y_2) , making an angle theta in such a way that if we go from (x_1,y_1) to (x_2,y_2) and then to (x_3,y_3) it forms counterclockwise direction.

Talon Mcbride

Talon Mcbride

Answered question

2022-07-17

How to find the third point at a given distance angle from a line segment in a plane?
Suppose i have a plane and a line segment with end points ( x 1 , y 1 ) , ( x 2 , y 2 ) is given to us.Now we need to find another point which lies at distance d from ( x 2 , y 2 ) , making an angle θ in such a way that if we go from ( x 1 , y 1 ) to ( x 2 , y 2 ) and then to ( x 3 , y 3 ) it forms counterclockwise direction.
Note : p 1 = ( x 1 , y 1 ) , p 2 = ( x 2 , y 2 ) , p 3 = ( x 3 , y 3 )
My approach : we can use dot product and it will give us equation of for Ax+By=C where A,B,C are constants.Then we can use information given by d. After solving two equations we will get two points , one in clockwise direction and other in counterclockwise direction . We can get out desired point using cross product (it will be negative for the point we want and positive for the other point).
You see that my approach is very lengthy .Is there any shortapproach ?

Answer & Explanation

Danica Ray

Danica Ray

Beginner2022-07-18Added 15 answers

Let
p 1 = [ x 1 y 1 ] , p 2 = [ x 2 y 2 ] , p 3 = [ x 3 y 3 ]
Distance between p 1 and p 2 is r,
r = p 2 p 1 = ( x 2 x 1 ) 2 + ( y 2 y 1 ) 2
Rotating a vector clockwise by φ around origin is
[ x new y new ] = [ cos φ sin φ sin φ cos φ ] [ x old y old ]
For counterclockwise rotation, use the transposed matrix (change both sin φ signs).
It seems to me we want to take the vector from p 2 to p 1 (i.e. p 1 p 2 ), scale it by d/r (so it will have Euclidean length d), and then rotate it around p 2 clockwise by θ. (The order of scaling and rotating doesn't matter, of course.)
Using
R θ = [ cos θ sin θ sin θ cos θ ]
in vector notation this would be
p 3 = p 2 + d r R θ ( p 1 p 2 )
i.e.
p 3 = p 2 + d ( p 1 p 2 ) ( p 1 p 2 ) R θ ( p 1 p 2 )
and the Cartesian coordinate notation is
{   x 3 = x 2 + d ( x 1 x 2 ) cos θ + d ( y 1 y 2 ) sin θ ( x 1 x 2 ) 2 + ( y 1 y 2 ) 2 y 3 = y 2 + d ( y 1 y 2 ) cos θ d ( x 1 x 2 ) sin θ ( x 1 x 2 ) 2 + ( y 1 y 2 ) 2

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?