I have two arrays of values which represent the Y value. I am trying to determine if line1 and line2 crossover/under each other during the set and if possible, return the index in the array they do. I have found code that can tell me a specific line but trying to see if there a better way to do this?
The data sets are below. line1[0] would be the most recent number in the series. Below I would like to test if line2 crosses over line1 and this would return index 1.
line1 = [25, 30, 25, 20, 15, 10]
line2 = [ 60, 40, 20, 17, 11, 5]