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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:10:32+00:00 2026-06-02T05:10:32+00:00

Geometry code gets tiresome after a while, but I want to finish this library,

  • 0

Geometry code gets tiresome after a while, but I want to finish this library, so here goes.

Basically, what’s the most efficient way to move one line segment, A, so that it no longer intersects with another, B?

Both line segments are defined with a start point (x, y) and a vector describing how the segment extends from that point (eX, eY). An example of how the line segment is described is below:

enter image description here

The solution I’m looking for is where the line segment is moved (its extent is not modified in any way) to the nearest location where it does not intersect. An example:

enter image description here

What is the most efficient way to get this result?

EDIT: People have asked what I mean by “move” – I mean change the (x, y) coordinate of the line segment start point. This will translate the entire segment.

And the line segments exist on the Cartesian plane, and any x/y movement is allowed.

  • 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-02T05:10:33+00:00Added an answer on June 2, 2026 at 5:10 am

    How about this: find the four vectors: two from red line’s endpoints going perpendicularly to the black line, and two going perpendicularly from the red line to the black line’s endpoints. Take the shortest of these vectors and move the red line along it.

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

Sidebar

Related Questions

If i run this Python code: from Tkinter import *; w = Tk(); w.geometry(
I wrote this code app = Tk() app.title('Myapp') app.geometry('260x100+50+50') labelText =StringVar() labelText.set('Insert the version
In the following code, i want to add IN +Village+. Where to add this
I'm using this code to create text in ArcMap. But I can't seem to
Here goes my code: <ControlTemplate TargetType={x:Type ToggleButton}> <Border x:Name=Chrome> <Grid x:Name=Arrow> <Grid.Background> <DrawingBrush Viewport=0,0,4,4
For a geometry library I'm writing I want to support multiplication of vectors by
The following code produces pretty much what I want, but the scrollable pane on
I have to code a simple control in .Net that draws geometry that looks
i have this snippet of code that use an iterator on a list for
the code as follow doesn't create the animation... But if the QPropertyAnimation is a

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.