How to plot unit tangent and unit normal vectors on a parameterized curve?
03:30 03 Nov 2025

I am working to practice on some simple parameterized curve given by:

import numpy as np
import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(6, 3))

t = np.linspace(-4, 4, 100)

x = t
y = t**3 - 9*t 

ax.plot(x, y, label = "curve")
ax.legend()

plt.show()

original

My problem: I would like to construct and show for some points on the plot:

  • the unit tangent vector T
  • the unit normal vector N, pointing towards the "concavity" (is it the right word?) of the curve

What I would like to have is depicted for 2 arbitrary points on the plot below (artificially constructed): wanted

How could I have this, in a "pythonic" way? I am just aware that np.gradient gives the derivatives, such as:

dydx = np.gradient(y, x)

But I have no practice in using it and don't know how to plot unit vectors and, of course, normal vectors... Any help in understanding how to do is appreciated.

python-3.x vector curve