Last active
June 29, 2022 17:41
-
-
Save tomilov/5f83d18f1243405e109128ffaeb33122 to your computer and use it in GitHub Desktop.
nonagon as result of intersection of parallelotope and triangle in space
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reset | |
set view equal xyz | |
unset border | |
unset tics | |
set xyplane 0 | |
set xrange [-3:3] | |
set yrange [-3:3] | |
set zrange [-3:3] | |
$cube << EOI | |
-2 -2 -2 | |
2 -2 -2 | |
2 -2 2 | |
2 2 2 | |
-2 2 2 | |
-2 2 -2 | |
-2 -2 -2 | |
-2 -2 2 | |
-2 -2 -2 | |
-2 -2 2 | |
2 -2 2 | |
-2 -2 2 | |
-2 2 2 | |
2 2 -2 | |
2 2 2 | |
2 2 -2 | |
2 -2 -2 | |
2 2 -2 | |
-2 2 -2 | |
EOI | |
$hexagon << EOI | |
0 -2 -2 | |
2 -2 0 | |
2 0 2 | |
0 2 2 | |
-2 2 0 | |
-2 0 -2 | |
0 -2 -2 | |
EOI | |
$triangle << EOI | |
3 0 3 | |
0 -3 -3 | |
-3 3 0 | |
3 0 3 | |
EOI | |
set title 'nonagon' | |
set object 1 polygon from -1,-1,-2 to 0,-2,-2 to 1,-2,-1 to 2,-1,1 to 2,0,2 to 1,1,2 to -1,2,1 to -2,2,0 to -2,1,-1 to -1,-1,-2 fillstyle solid noborder fillcolor rgb 'dark-green' | |
set terminal gif size 512, 512 animate delay 4 optimize | |
set output 'box_triangle_intersection.gif' | |
set angles degrees | |
do for [z=315:-44:-1] { | |
set view acos(1 / sqrt(3)), (z + 360) % 360, 1.3 | |
splot '$cube' with lines linecolor rgbcolor 'red' title 'cube', \ | |
'$hexagon' with lines linecolor rgbcolor 'green' title 'hexagon', \ | |
'$triangle' with lines linecolor rgbcolor 'blue' title 'triangle' | |
} |
Author
tomilov
commented
Jun 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment