0
$\begingroup$

I have two problems I will be very grateful if somebody helps me about them. If I have a line $L_1$ with a known point $(x_1, y_1)$ on it and has slope $\theta_1$, how do I know if a point $P=(x, y)$ is right to it or left? Or upper or lower?

The second problem, if I get the distance between the previous point $P$ and the previous line $L_1$ as $d = \sqrt{(x-x_1)^2 + (y-y_1)^2}$, how can I relocate $P$ to a different line $L_2$ with a known point $(x_2, y_2)$ on it and has slope $\theta_2$ keeping the same distance between the new point and $L_2$, so what's the new $(x, y)$ for point $P$?

I don't have much experience in Vectors and any help will be much appreciated.

Many thanks,

Thank you guys for the help, I have attached an image to clarify my second problem. I want to get the red point location which should be located at the same distance and side and angle to L2. It's more like transferring L1 and P to another location as if P is attached to the line and transferred with it. I know my terms is not scientific at all but I will try my best to understand. Many thanks again. http://i.stack.imgur.com/15Ja1.jpg

  • 0
    Your figure doesn't quite tell anything. According to you, you have a line $L_1$ and a point $P$ associated with it. You shift and rotate the point and line together to a new location. Is this right?2011-12-24

2 Answers 2

1

Problem 1

This has been answered in the comments by @J.M. So, I'll add it here for completeness.

Let the given point $(x_1,y_1)$ be denoted by $A_1$.

Find the equation of the line $L_1$, which you can do by the following equation. $y=\tan \theta_1.x + y_1-\tan \theta_1.x_1$

Now consider any other point $B_1(x_3,y_3) $ on this line, (you can find this plugging in $x_3$ (different from $x_1$ and less than $x_1$) in to the equation above). Now consider the signed area of the triangle $\Delta PA_1B_1$

$ \Delta = \dfrac{1}{2}(x(y_1-y_3)+x_1(y_3-y)+x_2(y-y_1))$

It is known that this area will turn out to be positive only when $P$, $A_1$, $B_1$ are taken in anticlockwise direction. From the figure, (please draw it in your mind), it is clear that if this area is positive, the point lies below the line $L_1$.

The other way, probably the easier way might be, to look at the sign of the value returned by $f=y-\tan \theta_1.x_1-y_1+\tan \theta_1.x_1$. This value is positive if the point lies above the line and negative, otherwise.


Problem 2

If you get the distance $d$ from $P$ to $A_1$ as that you have mentioned, it means the perpendicular from $P$ intersects $L_1$ at $A_1$.

You can relocate the point $P$ by shifting the origin suitably.

  • 0
    Hi Kannappan Sampath, I have edit my question. Thank you for your help.2011-12-24
1
  1. Try writing an equation for the line $L_1$ of the form $ax+by-c=0$. In your case, this would be $x+\theta_1 y-x_1-\theta_1 y_1=0$. A point $(x,y)$ then lies above the line if $\operatorname{sgn}(x+\theta_1 y-x_1-\theta_1 y_1) = \operatorname{sgn}(\theta_1)$, below the line if $\operatorname{sgn}(x+\theta_1 y-x_1-\theta_1 y_1) = -\operatorname{sgn}(\theta_1)$, to the right of the line if $x+\theta_1 y-x_1-\theta_1 y_1 > 0$ and to the left if $x+\theta_1 y-x_1-\theta_1 y_1 < 0$.

  2. This can be set up as the solution to a pair of equations. A point $(x,y)$ lies on $L_2$ if and only if $x+\theta_2 y-x_2-\theta_2 y_2=0$, while it has distance $d$ from $L_1$ if and only if $d=\frac{|x+\theta_1 y-x_1-\theta_1 y_1|}{\sqrt{1+\theta_1^2}}$. There are at most two solutions to this, one being the solution to $\begin{matrix} x+\theta_2 y=x_2+\theta_2 y_2\\ x+\theta_1 y=x_1+\theta_1 y_1 + d\sqrt{1+\theta_1^2} \end{matrix}$ which corresponds to the expression within the absolute value being positive, and $\begin{matrix} x+\theta_2 y=x_2+\theta_2 y_2\\ x+\theta_1 y=x_1+\theta_1 y_1 - d\sqrt{1+\theta_1^2} \end{matrix}$ which corresponds to the expression within the absolute value being negative. The solutions to these are $\begin{pmatrix}x\\ y\end{pmatrix} = \begin{pmatrix}1 & \theta_2\\ 1 & \theta_1\end{pmatrix}^{-1}\begin{pmatrix}x_2+\theta_2 y_2\\ x_1+\theta_1 y_1 + d\sqrt{1+\theta_1^2}\end{pmatrix}$ and $\begin{pmatrix}x\\ y\end{pmatrix} = \begin{pmatrix}1 & \theta_2\\ 1 & \theta_1\end{pmatrix}^{-1}\begin{pmatrix}x_2+\theta_2 y_2\\ x_1+\theta_1 y_1 - d\sqrt{1+\theta_1^2}\end{pmatrix}$

  • 0
    And, I guess the equation for $L_1$ seems to have a misplace $\theta_1$. The equation should have been $y=\theta_1.x+y_1-\theta_1.x_1$2011-12-24