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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:25:35+00:00 2026-06-03T08:25:35+00:00

I have 2 parallel lines in an 2D space. The lines are defined with

  • 0

I have 2 parallel lines in an 2D space.
The lines are defined with $min1, $max1, $min2, $max2

I already figured out how to check if they overlap:

function overlap($min1,$max1,$min2,$max2){
  if(($min1<$min2 && $max1>$min2) 
    || ($min1<$max2 && $max1>$max2) 
    || ($min1==$min2 && $max1==$max2) 
    || ($min2>=$min1 && $max2<=$max1)
    || ($min1>=$min2 && $max1<=$max2)){
    return true;
}
return false;
}

Now i have to check the overlaping length, but i have no idea how to implemnt this.

i need this to get the minmal translation vector in a separating axis theorem implementation

any hint would be great.

  • 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-03T08:25:36+00:00Added an answer on June 3, 2026 at 8:25 am

    Just a quick thought, but I think it works.

    Take the highest start value from the lines as start'
    Take the lowest end value from the lines as end'

    if start' < end' you have an overlap of (end' - start')

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

Sidebar

Related Questions

I have problem with loading my jqGrid. It just loads two parallel lines, and
As you can see below, I have Parallel.For loop. If run the program while
I have a Parallel.ForEach loop running an intensive operation inside the body. The operation
I have a parallel I/O project for parallel programming class, and I have to
Say I have 2 parallel collections, eg: a list of people's names in a
I have a simple Parallel.Foreach loop that has about 1000 rows in the DataTable,
I want to have 3 aligned parallel to each other. I have seen few
I have some experience using parallel extensions in .Net development, but I was looking
I have a question about Parallel Object Hierarchies such as DTO. Theses hierarchies has
I have a script that uses Parallel::ForkManager . However, the wait_all_children() process takes incredibly

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.