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()
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):
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...

