Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8096979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:36:45+00:00 2026-06-05T21:36:45+00:00

There is a points given in two dimensional plane and I want to count

  • 0

There is a points given in two dimensional plane and I want to count maximum collinear points for that I calculated all possible lines slopes and their intercepts.
To solve this problem, I tried to build a hash table but i am unable to find a hash function by which I can easily point all collinear points in one hash key. So help me to find out hash function that fits for this scenario?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:36:47+00:00Added an answer on June 5, 2026 at 9:36 pm

    This is not possible, because colinearity is not transitive. I.e., lets say A B and C lie on a line (i.e. are colinear). Therefore, A B and C should get the same hash key. Next, C D and E also lie on another line. Therefore, C D and E should also get the same hash key. Consequently, A B receive the same hash key as D and E, which is wrong because these points are not colinear.

    In addition, colinearity is defined on sets of points, so my above definition is rather vague. I.e. you cannot say A and B are colinear (well, you can, but if you only regard two points, each pair of points is colinear).

    What you can do is save the sets of colinear points in a hash map. Then, a good hash function would simply consist of the slope s and ordinate intercept i. For example, you could use s * 31i. This hash map can be used to add new points to the sets and finally count the size of the sets to retrieve your answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given two points in a 2D plane, and a circle of radius r that
Is there an algorithm that will, if given two nodes on a graph, find
Is there a clean Java method for merging the points of two given overlapping
Given a succession of points describing a polygon, is there some easy way of
Basically I have two 2D points and there is a line between them. A
I'm developing a program that makes some floating points calculations. Is there any way
So I have some function that receives N random 2D points. Is there any
Folks, is there a collection of gotchas where Numpy differs from python, points that
In two dimensional space, given a bunch of rectangles, every rectangle covers a number
Assume that I have a collection of 2 dimensional points, and a way to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.