Distribution of points on the surface of a cube
I need to describe the algorithms, the code, the files, the libs, and where they are located.
The code in ‘octahedron.f90’ corresponds to the octahedron centered at the origin of coordinates inscribed in a cube. The vertices of the octahedron lie on the center of the faces of the circumscribing cube.
The analytic expression of the octahedron is
i.e., centered at the origin of coordinates.
This an analytic function/expression for the surface of the cube:
max(abs(x),abs(x),abs(x)) = 1.0
Figure 1
$> module load gcc/10.3.0
$> gfortran -Wall -O2 -o cube.x cube.f90 lib/base.f90
In direct compilation and linking, the order of source files matters.
$> gfortran -Wall -O2 -o cube.x lib/base.f90 cube.f90
Including transform.f90
$> gfortran -Wall -O2 -o cube.x lib/transform.f90 lib/base.f90 cube.f90
Run:
$> ./cube.x > output.xyz
$> module load jmol
$> jmol output.xyz
Initial program version; only half of the cube is computed. See Fig1
Figure 1
To calculate the whole cube, I separate the pyramid in two parts: the equator (base of the pyramid) and the rest of the points up to the vertex. The latter group can be transformed into the missing cap that completes the cube.
In reality, the function cube
builds a bipyramid of square base, not a cube. See figures 2a and
2b.
Figure 2b with N = 12
- Note taken on [2022-12-01 Thu 11:57]
Recall to use ‘C-c C-x C-l’ to visualize mathematical expressions.
Examples
Figure 3
Test Math:
\[ \dfrac{\sqrt{2}}{2} ⋅ \left( \left|x\right| + \left|y\right| \right) \]
and
\[ \dfrac{\sqrt{2}}{2} ⋅ \left( \left|x + y\right| + \left|x - y\right| \right) \]
Is this teh surface of a cube of center edge
\[ \left|x - x_0\right| + \left|x - y_0\right| + \left|z - z_0\right| = d \]
BTA: to be tested and studied.