zoukankan      html  css  js  c++  java
  • 混沌数学之生物动力学混沌模型

    相关软件:混沌数学之离散点集图形DEMO

    相关代码:

    // 生物动力学混沌模型
    // http://wenku.baidu.com/link?url=yg_gE7LUXCg2mXRp-ZZdfRXXIkcNj8YOhvN7dKLJxzWIu6M0g33-W3y3culjalCYfNc5VQefVJEiEwi_woXP69H8W4x-bF22nIRnD2lsn53
    class BiologyChaotic : public DiscreteEquation
    {
    public:
        BiologyChaotic()
        {
            m_StartX = 0.0f;
            m_StartY = 0.2f;
    
            m_ParamA = 2.45f;
            m_ParamB = 1.0f;
            m_ParamC = 1.0f;
            m_ParamD = 1.0f;
        }
    
        void IterateValue(float x, float y, float& outX, float& outY) const
        {
            outX = x+0.00025f;
            outY = m_ParamA*y*(1 - m_ParamB*y - m_ParamC*_y - m_ParamD*__y);
        }
    
        // 计算点集的Y轴与X轴坐标
        void CalculatePointsXY(void* curveVerticesPtr, unsigned int stride, unsigned int count)
        {
            _y = m_StartY*0.5f;
            __y = _y;
    
            char* xPtr = (char*)curveVerticesPtr;
            char* yPtr = (char*)curveVerticesPtr + sizeof(float);
    
            float y, x;
            float nx, ny;
    
            x = m_StartX;
            y = m_StartY;
    
            for (unsigned int i = 0; i < count; i++)
            {
                *(float*)xPtr = x;
                *(float*)yPtr = y;
    
                IterateValue(x, y, nx, ny);
    
                _y = y;
                __y = _y;
    
                x = nx;
                y = ny;
    
                xPtr += stride;
                yPtr += stride;
            }
        }
    
        bool IsValidParamA() const {return true;}
        bool IsValidParamB() const {return true;}
        bool IsValidParamC() const {return true;}
        bool IsValidParamD() const {return true;}
    
    private:
        float _y;
        float __y;
    };

     相关截图:

     

     

  • 相关阅读:
    CSS:CSS 组合选择符
    CSS:CSS 布局
    CSS:CSS Float(浮动)
    CSS:CSS Positioning(定位)
    CSS:CSS Display(显示) 与 Visibility(可见性)
    CSS:CSS 尺寸 (Dimension)
    CSS:CSS 分组 和 嵌套 选择器
    CSS:CSS padding(填充)
    CSS:CSS margin(外边距)
    linux概念之/proc与/sys
  • 原文地址:https://www.cnblogs.com/WhyEngine/p/3972828.html
Copyright © 2011-2022 走看看