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

  • Home
  • SEARCH
  • 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 238171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:29:03+00:00 2026-05-11T20:29:03+00:00

Let assume you have two points (a , b) in a two dimensional plane.

  • 0

Let assume you have two points (a , b) in a two dimensional plane. Given the two points, what is the best way to find the maximum points on the line segment that are equidistant from each point closest to it with a minimal distant apart.

I use C#, but examples in any language would be helpful.

List<'points> FindAllPointsInLine(Point start, Point end, int minDistantApart)  
{  
//    find all points  
}
  • 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-05-11T20:29:03+00:00Added an answer on May 11, 2026 at 8:29 pm

    Interpreting the question as:

    • Between point start
    • And point end
    • What is the maximum number of points inbetween spaced evenly that are at least minDistanceApart

    Then, that is fairly simply: the length between start and end divided by minDistanceApart, rounded down minus 1. (without the minus 1 you end up with the number of distances between the end points rather than the number of extra points inbetween)

    Implementation:

    List<Point> FindAllPoints(Point start, Point end, int minDistance)
    {
        double dx = end.x - start.x;
        double dy = end.y - start.y;
    
        int numPoints =
            Math.Floor(Math.Sqrt(dx * dx + dy * dy) / (double) minDistance) - 1;
    
        List<Point> result = new List<Point>;
    
        double stepx = dx / numPoints;
        double stepy = dy / numPoints;
        double px = start.x + stepx;
        double py = start.y + stepy;
        for (int ix = 0; ix < numPoints; ix++)
        {
            result.Add(new Point(px, py));
            px += stepx;
            py += stepy;
        }
    
        return result;
    }
    

    If you want all the points, including the start and end point, then you’ll have to adjust the for loop, and start ‘px’ and ‘py’ at ‘start.x’ and ‘start.y’ instead. Note that if accuracy of the end-points is vital you may want to perform a calculation of ‘px’ and ‘py’ directly based on the ratio ‘ix / numPoints’ instead.

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

Sidebar

Ask A Question

Stats

  • Questions 130k
  • Answers 130k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Selectors/selected $("#userList option:selected").each(function(){ alert($(this).text()); }); May 12, 2026 at 6:02 am
  • Editorial Team
    Editorial Team added an answer some text \begin{figure}[h] \centering \includegraphics{images/something.png} \caption{Explanation of something} \end{figure} some… May 12, 2026 at 6:02 am
  • Editorial Team
    Editorial Team added an answer There really is no way to do it. No event… May 12, 2026 at 6:02 am

Related Questions

Let's say I have a (convex) polygon with vertices 0..n-1. I want to split
I have a somewhat ridiculous question regarding DDD, Repository Patterns and ORM. In this
I have transactional replication running between two servers over a dedicated VPN connection. The
Let's assume that I have two tables... Foo and Bar. They contain the following

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.