Questions tagged [overlap]

Two or more elements overlap when they partially or totally cover one another.

Two or more elements overlap when they partially or totally cover one another.
The way to find if the elements overlap or not is to test if one elements begins before the second one ends, while the second one begins before the first one ends.

For example, here are all of the ways two lines can overlap:

1.
s1|--------|e1
s2|--------|e2


2.
s1|-------|e1
     s2|--------|e2


3.
     s1|--------|e1
s2|--------|e2


4.
s1|-------------------|e1
     s2|--------|e2


5.
     s1|--------|e1
s2|-------------------|e2

Note that s1 is always smaller than e2, while s2 is always smaller than e1.

This is not the case when the two lines do not overlap:

1.
s1|--------|e1
                 s2|--------|e2


2.
                 s1|--------|e1
s2|--------|e2

Note that either s1 is bigger then e2 or s2 is bigger then e1.

The actual data type of the elements is completely irrelevant as long as it's comparable.

Therefore, to check if two elements overlap each other, all you need to do is this: (pseudo code)

If a.Start < b.End AND b.Start < a.End Then
    Overlap
Else
    No overlap
1905 questions
0
votes
3 answers

Best algorithm to find intersection and overlapping of ranges and storing the resultant range set

I have ranges let's say 1-10 20-40 30-50 55-65 65-80 75-90 95-100 As in this example 20-40 and 30-50 intersects instead of storing both I need to store it as 20-50. Then instead of 55-65,65-80 and 75-90 I want to store 55-90 alone. So the result…
Karthikeyan Gopall
  • 5,469
  • 2
  • 19
  • 35
0
votes
0 answers

Why 2 objects overlap even through there is correct Collision statement ?

bool right; bool left; bool jump; int G = 30; int Force; public Form1() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { …
0
votes
1 answer

CSS: overlaping images - showing extra transparent line

Im getting extra very think border when overlaping two images. The page contains mostly images and static magnifier. Part of original image shows in the magnifier when hovering this image using javascript. Magnifier is a PNG with transparent hole in…
Lakusqo
  • 9
  • 2
0
votes
1 answer

Android view clipping/subtracting

Is there any way in Android (from API 15) to clip/subtract views like masking in photoshop? See the example below: https://s31.postimg.org/d18lktjq3/index.jpg The Red view is just a bold funny V shape, while the blue one is something more complex.…
0
votes
2 answers

Determine Time overlap using hash in SAS

I have an sql script on SAS, which defines time overlap. Because table is very big, first I created smaller copy of that table and defined some new variables. to make lookup into table easier. data data.orders_small(drop=VALID_TO VALID_FROM…
Noza
  • 35
  • 1
  • 7
0
votes
2 answers

Fragment over another fragment within ViewPager

Hello I'm trying to build a ViewPager with 3 Fragments. One of this fragment have another fragment that overlap and I want implement swiping up and down to show and hide the fragment. Here there is a image that explain my question In the ViewPager…
Giacomo Lai
  • 494
  • 3
  • 15
0
votes
1 answer

Using a for loop to automate a function

I am trying to use this code, which calculates the fraction of overlap at a specific depth, to use at various depths. def score(list1, list2, depth): len_list = len(list1) frac = numpy.ceil(depth * len_list) frac = int(frac) s =…
Labrat
  • 105
  • 10
0
votes
1 answer

Make ul wrap, but not overlap

I am trying to wrap ul around an image without it overlapping Naturally it wraps, but also overlaps. I quickly fix this with: ul { overflow:hidden; } but that removes the wrap.
Chris Happy
  • 7,088
  • 2
  • 22
  • 49
0
votes
0 answers

latex \listoffigures and \listoftables numbers overlap caption

when using \listoffigues and \listoftables the numbers and the captions overlap each other. For example: "2-10 laminar flow" --> 10 and lam overlap each other. I'd like to add horizontal space without changing the format. I tried…
0
votes
0 answers

Spatial autocorrelation using Moran's I or other spatial overlap index

I have a file containing the data from bottom trawl survey. There are 102 draw's points to each with associated coordinates (Lon,Lat), for every set I calculated the density (DI N / 1km2) of the predator (merlmerDI N/1km2) and the density of its…
0
votes
2 answers

show data that exists in both MYSQL tables and/or R objects

i think its an regular problem, answered several times, but I just don't know how to ask the question right =( in MySQL: i have 2 tables with some kind of strings inside, now i want: 1. the data that occur in both tables 2. the data from a that is…
TekTimmy
  • 3,066
  • 2
  • 29
  • 33
0
votes
5 answers

How do I margin a div as much as another?

I want my holder to not to overlap with my navbar, can I set holder's margin-top to be exactly as much as my navbar without putting in numbers? Here's the html, #navbar { list-style-type: none; margin: 0; padding: 0; overflow:…
yanabeca
  • 35
  • 1
  • 1
  • 7
0
votes
2 answers

How to overlap two SVG vectors without using inline SVG?

I have two SVG vectors that I have overlapped by using CSS. See here. The shapes are as follows:
0aslam0
  • 1,797
  • 5
  • 25
  • 42
0
votes
1 answer

How to overlap text onto another cell in vba excel

hey guys i have this small piece of code: If IsEmpty(Cells(8, M8).Value) And IsEmpty(Cells(14, M8).Value) = True Then Sheets("Schedule").Cells(8, M8).Value = info …
0
votes
2 answers

how i can overlap two lines in regex?

i have to lines o erl pp ng st i g v a i r n i want to get "overlapping string " please help me i use notepad++
user6481216
1 2 3
99
100