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 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

Related Questions

Let's say we have two objects. Furthermore, let's assume that they really have no
Let's assume we have two collections: List<double> values List<SomePoint> points where SomePoint is a
For example, let's assume that i have two QuerySEt objects: queryset1 = my_model1.objects.all().order_by('-created') queryset2
Let's assume that I have two tables... Foo and Bar. They contain the following
I have some question about linux-kernel, let's assume that I have two threads in
Let's assume I have two gmdistibution models that i obtained using modeldata1=gmdistribution.fit(data1,1); modeldata2=gmdistribution.fit(data2,1); Now
Let's assume we have two arrays of the same size - A and B
I'm trying to create an expression tree dynamicly. Let asume that I have two
Let's assume I have a model called product. Let's assume that product has three
Let's assume I have a main script, main.py, that imports another python file with

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.