B
bob123456789
This task involves projecting a 4-dimensional hypercube onto a hyperplane (ie a 3-dimensional space).
Let the hypercube have its vertices at the points (±1, ±1, ±1, ±1), where all 16 vertices are obtained by using all combinations of plus and minus signs. The hyperplane to be projected to must have the fourth dimension coordinate 0 (in analogy with 3D, the xy plane is the plane where the third dimension coordinate z = 0).
The projection must be a so-called oblique projection along a vector U from the vertices to a point in the hyperplane. One way to solve it is to go from a corner of the hypercube along the vector U until you reach the hyperplane (the one with the fourth coordinate equal to zero).
Use the vector U = (2, 3, 4, 5).
Report the 3-dimensional coordinates that the corners of the hypercube get after the projection and draw the projected hypercube in a figure with edges between nearby corners. Remember that there are no edges between all the vertices (use the analogy of a regular cube and figure out between which vertices of the cube there are edges).
This should preferably be done with Matlab.
Any help is appreciated!
This is as far as I've gotten:
Let the hypercube have its vertices at the points (±1, ±1, ±1, ±1), where all 16 vertices are obtained by using all combinations of plus and minus signs. The hyperplane to be projected to must have the fourth dimension coordinate 0 (in analogy with 3D, the xy plane is the plane where the third dimension coordinate z = 0).
The projection must be a so-called oblique projection along a vector U from the vertices to a point in the hyperplane. One way to solve it is to go from a corner of the hypercube along the vector U until you reach the hyperplane (the one with the fourth coordinate equal to zero).
Use the vector U = (2, 3, 4, 5).
Report the 3-dimensional coordinates that the corners of the hypercube get after the projection and draw the projected hypercube in a figure with edges between nearby corners. Remember that there are no edges between all the vertices (use the analogy of a regular cube and figure out between which vertices of the cube there are edges).
This should preferably be done with Matlab.
Any help is appreciated!
This is as far as I've gotten:
vertices = [-1 -1 -1 -1; -1 -1 -1 1; -1 -1 1 -1; -1 -1 1 1;
-1 1 -1 -1; -1 1 -1 1; -1 1 1 -1; -1 1 1 1;
1 -1 -1 -1; 1 -1 -1 1; 1 -1 1 -1; 1 -1 1 1;
1 1 -1 -1; 1 1 -1 1; 1 1 1 -1; 1 1 1 1];
U = [2, 3, 4, 5];
projected_vertices = zeros(16, 4);
V = [0.5,0.5,0.5,0.5];
% Projection for each vertice
for i = 1:16
vertex = vertices(i, : )
t = ?
projected_vertices(i, : ) = vertex + t * V;
end
% Fourth coordinate should be 0
disp(projected_vertices)
-1 1 -1 -1; -1 1 -1 1; -1 1 1 -1; -1 1 1 1;
1 -1 -1 -1; 1 -1 -1 1; 1 -1 1 -1; 1 -1 1 1;
1 1 -1 -1; 1 1 -1 1; 1 1 1 -1; 1 1 1 1];
U = [2, 3, 4, 5];
projected_vertices = zeros(16, 4);
V = [0.5,0.5,0.5,0.5];
% Projection for each vertice
for i = 1:16
vertex = vertices(i, : )
t = ?
projected_vertices(i, : ) = vertex + t * V;
end
% Fourth coordinate should be 0
disp(projected_vertices)
Last edited by a moderator: