Let A and B two real closed intervals.
I define b(x) as B+x for any real x ; more precisely, if B=[B1, B2], b(x) = [B1+x, B2+x]
I want to build a function f(x) such that :
- if A and b(x) do not overlap then f(x) = 0
- otherwise f(x) is some expression of the covering length
For example : if A=[0, 2] and B=[-2,-1], then
- f(x) = 0 if -1+x < 0 or -2+x > 2
- otherwise f(x) = L where L is the measure of the intersection of A and b(x)
I coded a few variants using piecewise or Heaviside functions.
In some sense I have already answered my own question ... but no one is neither elegant nor concise.
I wonder if there exist a Maple function that returns the measure of the intersection of two real intervals (when they overlap) and 0 otherwise ?