I am not sure how to make this formula work...

Let’s say we had a very weird two dimensional, sinusoidal topography such that z = f(x) = sinx with z the height and x is the distance from some marker. The slope in the x direction

I am trying to convert the scalar field (height versus position) to a vector field (direction and magnitude of greatest slope) mathematically