   line intersects a point?
  Hi everyone,Sorry to keep annoying you all with annoying geometry questions, this will hopefully be the last one. Is there some formula I can use to see if an (x,y) point is intersected by a line whose origin and slope I know?:    bool bIntersects =   LineIntersectsPoint(ptOrigin.x,    ptOrigin.y,   Rise,   Run,   ptIntersectTest.x,   ptIntersectTest.y);So for example, if I have an origin point (2,2), and a slope -5/2, could I test if a line drawn from (2,2) with slope -5/2 intersects say point (4,-3)? Thanks as always,Mark   
  if you know the origin and slope of the line then you know the slope-intercept equation for the line, y = mx + b.Simply plug in the x value of the point in question and if the result equals the y value of the point in question, then it is on the line.;  More specifically: a line with origin (a,b) and slope m has the formula y-b=m(x-a), or y=m(x-a)+b [they are equivalent]. So, to check if your point lies on the line, find m(x-a)+b where m is the slope, x is the x co-ordinate of the point, a is the x co-ordinate of the origin and b is the y co-ordinate of the origin. Check this value against the y co-ordinate of the point you're checking. If they're the same, the point lies on the line.   ;  Just for note: rounding errors can cause any == statement involving floats to fail.  So instead of checking if the Y coordinates are equal, check if the Y coordinates are within a small epsilon of each other (-.00001 < y - ty < .00001)   ;  If I recall correctly, the minimum (perpendicular) distance from a point to a normalised ray through the origin is equal to the absolute value of their cross product. So something likebool IsPointOnLine(Vec3 ray1, Vec3 ray2, Vec3 point, float epsilon) {    // ray1 and ray2 are distinct points on the line    Vec3 ray = Vec3Normalise(ray2 - ray1);    Vec3 translated_point = point - ray1;    Vec3 cross_product = Vec3Cross(ray, translated_point);    return (abs(Vec3Length(cross_product)) < epsilon);}may work better for you, if you're using vectors. Code is written for clarity rather than performance.RegardsAdmiral   ;  Hi guys,So I would run it like this?    ptOrigin = (4,2);    nRise    = 4;    nRun= 6;    ptTest   = (7,6);    y = (nRise/nRun) * (ptTest.x - ptOrigin.x) + ptOrigin.y;    if (fabs(y-ptTest.y) < 0.00001) {    // yes intersect.    }Admiral, I will take a look at your example now too, thanks so much eveyone,Mark   