Number of lines passing through atleast three points

Revision en1, by pks18, 2020-09-16 09:50:06

The question is as follows:-

We are given n coordinates in the form of (xi,yi) for ith coordinate. Then we need to find the number of lines passing through atleast three points?

I have a feeling it would be n^3 approach with checking of slopes, but I am not able to boil down it to code. I am particularly facing problem in the case when 4 or more points fall in the same line. How to stop double counting?

Help would would be greatly appreciated.

Tags #geometry, simplemaths

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English pks18 2020-09-16 09:50:06 509 Initial revision (published)