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 6365197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:15:48+00:00 2026-05-25T00:15:48+00:00

I have four point p0 , p1 ,p1′ , p2′ , each defined by

  • 0

I have four point p0 , p1 ,p1′ , p2′ , each defined by x,y,z component and all lay on one line as in the figure

enter image description here

I want to get the line segment (the dashed part) result from the intersection between the four points

any suggestion , or sample code using C#

  • 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-25T00:15:49+00:00Added an answer on May 25, 2026 at 12:15 am

    This is more or less the same answer as Howard gave but pressed into C# … I hope this helps with your code-base.

    This code snippet should do the trick (finding the mid-points from your 4, but only if all are colinear) – also note I don’t check for real intersection, you can do this easily youself by inspecting the answer and your points.
    I did not take the time and implement the Vector3D struct in a sensible manner (operators, …) – you can do this easily too.
    Also note that this will work for not only 4 points but keep your diagram in mind.

    private struct Vector3D
    {
        public double X { get; set; }
        public double Y { get; set; }
        public double Z { get; set; }
    }
    static class Vectors
    {
        static public double ScalProd(Vector3D v1, Vector3D v2)
        {
            return v1.X*v2.X + v1.Y*v2.Y + v1.Z*v2.Z;
        }
    
        static public Vector3D Minus(Vector3D v1, Vector3D v2)
        {
            return new Vector3D {X = v1.X - v2.X, Y = v1.Y - v2.Y, Z = v1.Z - v2.Z};
        }
    
        static public Vector3D Normalize(Vector3D v)
        {
            var len = Math.Sqrt(ScalProd(v, v));
            return new Vector3D {X = v.X/len, Y = v.Y/len, Z = v.Z/len};
        }
    }
    
    private Vector3D[]  FindIntersectionOnCoLinearVectors(params Vector3D[] input)
    {
        if (input.Length < 2) throw new Exception("you need a minimum of two vectors");
        var v0 = input[0];
        var direction = Vectors.Normalize(Vectors.Minus(input[1], v0));
        Func<Vector3D, double> projectOntoLineStartingAtv0 =
            v => Vectors.ScalProd(direction, Vectors.Minus(v, v0));
        var mapped = input.OrderBy(projectOntoLineStartingAtv0).ToArray();
        return new Vector3D[] {mapped[1], mapped[2] };
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have four arrays of data (3072 bytes each.) I want to point to
I have some databases that have four files each; one for PRIMARY, IDX, IMAGE,
I have four tables containing exactly the same columns, and want to create a
I have four flags Current = 0x1 Past = 0x2 Future = 0x4 All
I have four UINavigationControllers assigned each to a tab in a UITabBarController. Each UINavigationController
I have four models that are related to one another, the way I have
I have 2 rectangles they are placed arbitrarily and I have rects all four
At point (3) in my code I have defined a query called query1 in
I have DB table defined with four columns: short, controller, action, id And using
I have a presentation web farm with four load-balanced servers. I have one web

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.