# How to plot a 4-dimensional relation in an animated way?

If we have an relation like this one:

$$r(x_1,y_1) = (x_1^2 - y_1^2, 2 x_1 y_1) = (x_2,y_2)$$

How can we plot it on a 4-dimensional space?

Where the axis are: $$x_1,y_1,x_2,y_2$$.

And the variables may vary from $$[-10,10]$$ for $$x_1$$ and $$y_1$$.

I'm looking to something like this animation here. Where we can see a hypercube on a 3D view but with an animation in the other dimensions. I'm aiming to use the Animate function, with a dynamic parameter to create a visualization like this one that we can see in the hypercube on the link above.

• – Kuba Nov 15 '18 at 13:08
• Since your function could be considered r(z) -> ReIm[z^2] maybe you will find inspirations in complex plotting related posts. – Kuba Nov 15 '18 at 13:26
• Project $(x_2,y_2)$ down to a rotating unit vector: Animate[Plot3D[{x^2 - y^2, 2 x y}.AngleVector[t], {x, -1, 1}, {y, -1, 1}, PlotRange -> {-1, 1}, RegionFunction -> Function[{x, y}, x^2 + y^2 <= 1], PerformanceGoal -> "Quality", PlotPoints -> 10, MaxRecursion -> 0, Mesh -> 3], {t, 0, 2 \[Pi]}] – Rahul Nov 15 '18 at 15:30