In this video Grant performs a non linear transform. The transform from cartesian to polar is also non-linear. We find the determinant of the jacobian matrix to be 1/r. I could replicate the transform that Grant did, but how to animate this cartesian to polar using manim. In other words, what would be f1 and f2. I tried (x^2 + y^2)^0.5 and arctan(y/x)
def construct(self):
def arctan(x, y):
if x and y == 0:
return 0
else:
return np.arctan(y / x)
grid = NumberPlane()
grid.prepare_for_nonlinear_transform()
self.play(
grid.apply_function,
lambda p: p + np.array([
(p[0]**2 + p[1]**2)**0.5,
arctan(p[0], p[1]),
0,
]),
run_time=3,
)