input: Write a function to find the shortest path between two points in a matrix. The function should take a matrix, a start point, and an end point as inputs. It should return the length of the shortest path from the start point to the end point, considering that the cell with value 0 is an obstacle and cannot be part of the path. If no path exists, the function should return math.inf.
  
  assert shortest_path([[2, 3, 5], [1, 7, 6], [3, 0, 9]], (0, 0), (2, 2))==5
  assert shortest_path([[1, 0, 1], [1, 1, 1], [1, 0, 1]], (0, 0), (2, 2))==math.inf
  assert shortest_path([[1, 1, 1], [1, 1, 1]], (0, 0), (1, 2))==3
  assert shortest_path([[0, 1, 0], [1, 1, 1], [0, 1, 0]], (0, 1), (2, 1))==3
  assert shortest_path([], (0, 0), (0, 0))==math.inf
output: import math
  from collections import deque
  
  def shortest_path(matrix, start, end):
      if not matrix or matrix[start[0]][start[1]] == 0 or matrix[end[0]][end[1]] == 0:
          return math.inf
      
      rows, cols = len(matrix), len(matrix[0])
      directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]
      queue = deque([(start[0], start[1], 0)])
      visited = set()
      visited.add(start)
      
      while queue:
          x, y, dist = queue.popleft()
          
          if (x, y) == end:
              return dist
          
          for dx, dy in directions:
              nx, ny = x + dx, y + dy
              if 0 <= nx < rows and 0 <= ny < cols and (nx, ny) not in visited and matrix[nx][ny] != 0:
                  visited.add((nx, ny))
                  queue.append((nx, ny, dist + 1))
      
      return math.inf