A vector field can be derived from a scalar function by computing its gradient. In this example, we define a scalar function:
Let's visualize this vector field and see how changing the parameter affects it.
Now we can visualize the vector field using gm.vector_field, which
automatically computes the gradient at each point:
Try changing the value of a to see how the vector field transforms.
Set , or .