is point on the line?

timstudiesmath shared this question 9 years ago
Answered

I have a sequence of random points, and I want to know how many are on a line f. Is there an easy way to check if a point is on a line?


For a point A and linear function f(x), I thought of checking f(x(A))==y(A), but that seems like it'd be slow, and wouldn't work for an implicit line f.

Comments (2)

photo
1

If the list of random points is L and the line is a, try


CountIf[x==0,Zip[Distance[A,a],A,L]]

photo
1

Thank you both so much! This forum is amazing.


http://tube.geogebra.org/ma...


I'm working on layers, getting a list of points (layer 9) on top of an input box (layer 8), but in this example, I can just open the file in GeoGebra, which stretches things out enough to make the issue vacuous.


Thanks again!


Tim

© 2021 International GeoGebra Institute