import numpy as np

def calculate_ndvi(red, nir):

    ndvi = (nir - red) / (nir + red + 1e-10)

    return ndvi