Sign in to follow this  

Point on line

Recommended Posts

Not sure whether this isn't homework. So for now I will reply something vague.

The representation of your line is "the line that goes through these 2 points". However, there are other representations, too. One other representation is "all points of the space that lie on the line" would help you, since the point of interest has to be one of all those points to fulfil the condition. The mentioned representation is named a ray. A ray has a parameter, and you have to compute whether a value of the parameter can be found so that the ray hits the point of interest. An approach to compute the ray representation would be to express the linear hull of the 2 given points and to isolate the weighting parameter.

Share this post

Link to post
Share on other sites
For example you can use the most intuitive algebraic way to check this this:

Algebraic way:
you have two points P1=(x1,y1,z1), P2=(x2,y2,z2).

to create a line L(t) from P1->P2

L(t) = P1(1-t) + P2*t

When t=1 then L(t) = P2 and when t=0 L(t) = P1. Since L(t) is a linear function it must be a line through P1 and P2 in R^3.

Now we want to check if it "intersect" P3=(x3,y3,z3).

To do this we simple solve the equation in _t_: P3 = P1(1-t)+P2*t, it has exactly one solution in t if P3 is on the line, and zero if P3 is not on the line.

Share this post

Link to post
Share on other sites
It is not a homework. I am working in ARX and solve that problem with drawing a line between two points and checked if point is on line.

AcGeLine3d myLine (pointBefore, pointAfther);
if(myLine.isOn(pointToCheck)) return true;
return false;

I was just curius how to mathematical check that.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this