so the other day I was doing my daily

browsing of Wikipedia when I found this

it represents a four dimensional cube or

tesseract undergoing a rotation along

both the XY and Z W planes

simultaneously this completely boggled

my mind and I just had the simulated

first of all let me point out that the

visualization is not four dimensional

rather it is a representation of four

dimensions in three dimensions and it is

then rendered on a two-dimensional

screen what does this mean well let's

take a cube it's a perfectly fine 3d

object I mean it's no four dimensional

cube or anything but it'll do for now we

can represent this cube as a series of

planes or cross-sections cut along the

XY or z axes obviously the 2d planes are

not actually 3d cubes rather they are

representations of 3d objects in a 2d

space if we take two planes one at Z

equals negative 0.5 and another at Z

equals positive 0.5 and connect these

two planes with lines that represent all

other possible planes along that axis we

once again see a cube this is kind of

the visualization we'll be doing for our

4d tesseract if we take a cross-section

along the W dimension let's say at W

equals a negative 0.5 we'll find a

three-dimensional cube and if we move

along the W dimension from W equals

negative 0.5 to positive 0.5 will see

that this cube scales in size now just

like in the 3d case the lines connecting

these cubes represent

the sum of all cross-sections between

the two cubes so this is not a perfect

representation but it's as close as we

can get so we have a representation of a

tesseract a four-dimensional cube now

let's rotate it in Cartesian XY

coordinates we can rotate a system with

a simple rotation matrix in four

dimensions this doesn't really change we

can see a rotation in the XY plane

simply by tacking an identity matrix

onto the end of our rotation matrix so

now let's get a little crazy what

happens if instead of rotating in the XY

plane we rotate instead in the Z W plane

well this happens

we cannot represent the W plane very

well so it looks like one cube rotates

around and engulfs the other cube in an

endless struggle for dominance now it

doesn't stop there because both of our

rotation matrices have two dimensions

free at any given moment we may actually

perform a special type of rotation known

as a double rotation by rotating in both

the XY and Z W planes at the same time

and with this we can finally replicate

the animation on Wikipedia but wait

there is something I missed a second ago

projections if we have a

four-dimensional point how do we

represent it in 3d well the obvious

answer is to take a 3 by 4 matrix and

multiply by that but if we take any

arbitrary matrix say the identity matrix

with zeroes along the W dimension the

rotation doesn't look quite right this

is because most tesseract depictions use

stereographic projections which resemble

the act of holding a light source behind

an object and checking its shadow

against the screen of course for this

analogy to work for projections from 40

to 3d we have to assume that our screen

can somehow hold three-dimensional

objects but let's ignore that for now

basically all we need to do is divide

every element in the matrix by LW minus

W where LW is the position of the light

source on the W axis and W is a position

of the point itself that we are

projecting now here's the cool part by

varying our LW parameter the location of

our light source along the W axis we can

see dramatically different

visualizations even though the rotations

themselves have not changed so there you

have it

how does simulate a tesseract undergoing

double rotation I found this incredibly

cool and I hope you did too thanks for

watching and I'll see you next time