# How to know direction of point

Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last
• June 7th 2010, 01:42 AM
Zirok
How to know direction of point
Hi
I use the formula based on pythagorous therom (refer attachment) to calculate the distance from Orientation Point to 2 different points
The problem to me is how to know the direction of the point. These points lie on opposite side (from orientation point) & how to know which one is on positive or negative side.
Thanks
• June 7th 2010, 02:18 AM
undefined
Hi Zirok,

I'm not sure what you're after. If we think of point $P_1 = (x_1,y_1)$ as a vector and likewise $P_2 = (x_2,y_2)$, then the direction from $P_1$ to $P_2$ will be the direction of the vector $P_2 - P_1$. If we wanted to, we could divide by the distance from $P_1$ to $P_2$ to get the unit vector in that direction.

Is this what you're looking for?
• June 7th 2010, 02:44 AM
Zirok
Actually we need to know the direction of the point.

Suppose (-25.0-25.0) is the orientation point & Point A is ( -10.0,-10.0) & Point B is (-40.0,-40.0)

The distance calculated will be the same for both the points with respect to orientation point, but what would determine the direction. Whether Point A or B is on positive/negative side.

Remember, that we cannot decide the direction by comparing the Point A/B wrt to Orientation Point. Some therom has to derive it.

Zirok
• June 7th 2010, 02:50 AM
undefined
Quote:

Originally Posted by Zirok
Actually we need to know the direction of the point.

Suppose (-25.0-25.0) is the orientation point & Point A is ( -10.0,-10.0) & Point B is (-40.0,-40.0)

The distance calculated will be the same for both the points with respect to orientation point, but what would determine the direction. Whether Point A or B is on positive/negative side.

Remember, that we cannot decide the direction by comparing the Point A/B wrt to Orientation Point. Some therom has to derive it.

Zirok

I guess you haven't learned what vectors are yet? Maybe you'd rather have the direction given as an angle between 0 and 360 degrees? I can't help you unless I know what form your answer must be in.
• June 7th 2010, 03:08 AM
Zirok
Refering to the attachment, we have intersection points of A,B,C,D as our refrence.

I have written a forumla in excel to calculate distance d1,d2,d3,d4 from this intersection point.

How would i know that d2 distance is negative ( or in a reverse position) ??
• June 7th 2010, 03:43 AM
undefined
Quote:

Originally Posted by Zirok
Refering to the attachment, we have intersection points of A,B,C,D as our refrence.

I have written a forumla in excel to calculate distance d1,d2,d3,d4 from this intersection point.

How would i know that d2 distance is negative ( or in a reverse position) ??

If I'm interpreting correctly, then what you're really trying to solve is finding the intersection point of 4 circles.

You're given A, B, C, D, and d1, d2, d3, d4, and you need to find the intersection point, right?

So you'll find that the circle with center A and radius d1 is tangent to the circle with center B and radius d2. This will already be the point of intersection. You can also see that C and D intersect at a single point of tangency, which is the same intersection point.

To find the point of intersection, find the equations of the two circles in question, and solve the system.

• June 7th 2010, 04:16 AM
Zirok
No, this is not for finding intersection point of 4 circles.

Point A & B lie on Line 1 & Point C & D lie on Line 2
The intersection of these two lines is as shown.
Now, we calculate the distance of d1,d2,d3,d4 to analyze further.

But as d2 distance is on other side we are facing serious problems for our further analysis.

THANKS
zIROK
• June 7th 2010, 04:25 AM
undefined
Quote:

Originally Posted by Zirok
No, this is not for finding intersection point of 4 circles.

Point A & B lie on Line 1 & Point C & D lie on Line 2
The intersection of these two lines is as shown.
Now, we calculate the distance of d1,d2,d3,d4 to analyze further.

But as d2 distance is on other side we are facing serious problems for our further analysis.

THANKS
zIROK

Okay, let's define the intersection point as E, and the coordinates of all the points as

$A = (x_A, y_A)$

$\cdots$

$E = (x_E, y_E)$

Is E to the right of A?

We have: $x_E > x_A$ therefore, yes, E is to the right of A.

We ask, is E to the right of B?

We have: $x_E < x_B$ therefore, no, E is to the left of B.

In other words, E is between A and B, and the distance between A and B is d1 + d2.

On the other hand, similar analysis leads us to conclude that C is between D and E. So the distance between C and D is d4 - d3.

Does that help?
• June 7th 2010, 04:41 AM
Zirok
Hi

Thanks for your attempt, my working direction is not to calculate A & B. My intention is to analzye & swap these points according to distance d1,d2,d3,d4.

So, if i get some hint that d2 is on reverse side, i can take appropriate action.

Zirok
• June 7th 2010, 04:54 AM
undefined
Quote:

Originally Posted by Zirok
Hi

Thanks for your attempt, my working direction is not to calculate A & B. My intention is to analzye & swap these points according to distance d1,d2,d3,d4.

So, if i get some hint that d2 is on reverse side, i can take appropriate action.

Zirok

I can't read your mind. If you don't tell me what you're trying to find, I won't be able to guess it magically.

I think "attempt" was a poor choice of words on your part. It implies that I failed somehow. I only failed in being a psychic and reading your mind.

Notice that "swap these points according to distance d1,d2,d3,d4" is still vague and could mean many things.

I don't think I feel like attempting to read your mind anymore. Let someone else do it.
• June 7th 2010, 05:12 AM
Zirok
Hey sorry dear,

I apologize for the harsh & abrupt words used.

I will tell you the problem in detail -
Points A,B,C,D are entered by the user. A great possibility is that wrong points can be inputted by the user. For example, Point A position in Point B's Dialog Box & Point B into Point A's Dialog Box.

So, the trick i am doing is to calculate the intersection point & than from that point calculate d1,d2....
d1 = distance from Intersection point ( IP ) to Point A
d2 = ------------------------------------to Point B
d3 = -------------------------------------to Point C
d4 = -------------------------------------to Point D

Than, the logic is that Point A & C ( i mean actual positions of Points )should always be closer to Intersection Point & Point B & D should always be far.

So even if the user enters the positions to & fro, the calculation will not fumble.

But as the distance calculted (d2) is in opposite direction, it doesnt gets swapped ( interchanged ) & NEED SOME HINT/CLUE that the Point is on Negative Side so i can take action accordingly.

I hope I was not to confusing.

Thanks & Sorry
Zirok
• June 7th 2010, 05:12 AM
Unknown008
Quote:

Originally Posted by Zirok
Hi

Thanks for your attempt, my working direction is not to calculate A & B. My intention is to analzye & swap these points according to distance d1,d2,d3,d4.

So, if i get some hint that d2 is on reverse side, i can take appropriate action.

Zirok

I'm with undefined here...

What do you want to know about this problem that you are analysing? What do you want to show?

You said that you want to know whether distance d2 is negative, but distance is never negative, it is a scalar quantity. Displacement is. But if d2 is a displacement vector, what does all the points A, B, C and D represent? What do the lines joining the points d1 and d2, and d3 and d4 represent?

I'm just trying to understand more what you are asking.

EDIT: More info are required still. Perhaps you could post the actual question in full, with all the details and the instructions. What are you trying to show? Is there an everyday example where what you are doing is applied? Maybe this will help us understand better.
• June 7th 2010, 05:27 AM
undefined
Quote:

Originally Posted by Zirok
Hey sorry dear,

I apologize for the harsh & abrupt words used.

I will tell you the problem in detail -
Points A,B,C,D are entered by the user. A great possibility is that wrong points can be inputted by the user. For example, Point A position in Point B's Dialog Box & Point B into Point A's Dialog Box.

So, the trick i am doing is to calculate the intersection point & than from that point calculate d1,d2....
d1 = distance from Intersection point ( IP ) to Point A
d2 = ------------------------------------to Point B
d3 = -------------------------------------to Point C
d4 = -------------------------------------to Point D

Than, the logic is that Point A & C ( i mean actual positions of Points )should always be closer to Intersection Point & Point B & D should always be far.

So even if the user enters the positions to & fro, the calculation will not fumble.

But as the distance calculted (d2) is in opposite direction, it doesnt gets swapped ( interchanged ) & NEED SOME HINT/CLUE that the Point is on Negative Side so i can take action accordingly.

I hope I was not to confusing.

Thanks & Sorry
Zirok

Okay we're getting closer! (Smile)

However, I don't follow your logic. Suppose we have the following points,

Attachment 17174

defining the lines shown.

Attachment 17175

If we switch two points that are not on the same line, we get a different intersection point.

Attachment 17176

So could you explain how that's supposed to work out?
• June 7th 2010, 05:42 AM
Zirok
Hi...

Thanks (Happy)

Points A & B can misentered by user as they lie on a common line.

If he enters Point A correct & Point B (actually he enters C position in "B" dialog box ), then we cannot help.

User has to define 2 LINES Correctly. We are there to correct his typing errors.

I hope that was not too confusing.

Thanks
Zirok
• June 7th 2010, 05:50 AM
undefined
Okay, so is it true that

d1 should always be less than d2

d3 should always be less than d4

?

Because if so, the direction doesn't matter. In the image you posted, d2 < d1, therefore A and B should be switched. d3 < d4, so there is no switching necessary.

Please clarify your meaning further so we can get to the bottom of this!
Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last