E-CloudIs a concept in physics. An electron performs high-speed motion in a very small space outside the nucleus. Its motion is different from that of a general object. It has no definite orbit. According to the uncertainty principle in quantum mechanics, it is impossible for us to accurately determine the position and velocity of an electron at a certain time point at the same time, nor to draw its trajectory. Therefore, it is often used to describe the movement of electrons outside the core space in a certain period of time. In this model, the density near a certain point indicates the size of the opportunity for an electron to appear here. Where the density is high, it indicates that there are many opportunities for electrons to appear in the unit volume outside the core space; otherwise, it indicates that there are few opportunities for electrons to appear. Because this model is similar to a "cloud" with a layer of density outside the nucleus, people call it an "electronic cloud ".
I think this code should be regarded as a pseudo-electronic cloud. Here we only generate a spherical harmonic surface and then randomly generate a point set in the surface. I have seen an algorithm used to generate an e-cloud algorithm, but I don't want to copy it because I cannot understand its specific parameter settings.
// Electronic cloud class ElectronCloud: public FractalEquation {public: ElectronCloud () {m_StartX = 0.0f; m_StartY = 0.0f; m_StartZ = 0.0f; m_ParamA = 1.0f; m_ParamB = 2.0f ;} void IterateValue (float x, float y, float z, float & outX, float & outY, float & outZ) const {int a = (int) fabsf (m_ParamA ); int B = (int) fabsf (m_ParamB); float u = yf_rand_real (PI * 2); float v = yf_rand_real (PI); float l = yf_rand_real (1.0f ); float r = sinf (a * v) * cosf (B * u) * l; outX = r * sinf (v) * sinf (u ); outY = r * cosf (v) * 0.5f; outZ = r * sinf (v) * cosf (u);} bool IsValidParamA () const {return true;} bool IsValidParamB () const {return true;} bool Is3D () const {return true;} private: int m_nIterateCount ;};
For the definition of the basic class FractalEquation and related software, see chaos and FractalEquation.
The generated image is as follows:
Chaotic and fractal electron cloud