混沌数学之Baker模型

 

相关DEMO参见:混沌数学之离散点集图形DEMO

相关代码:

// http://wenku.baidu.com/view/ac9b57ea172ded630b1cb65b.html
class BakerEquation : public DiscreteEquation
{
public:
    BakerEquation()
    {
        m_StartX = 0.25f;
        m_StartY = 0.25f;
    }

    void IterateValue(float x, float y, float& outX, float& outY) const
    {
        if (x < 0.5f)
        {
            outX = 2*x/*+0.00001f*/;
            outY = y*0.5f;
        }
        else
        {
            outX = 2*x - 1;
            outY = (y+1.0f)*0.5f;
        }
    }
};

//class Baker2Equation : public DiscreteEquation
//{
//public:
//    Baker2Equation()
//    {
//        m_StartX = 0.25f;
//        m_StartY = 0.25f;
//    }
//
//    void IterateValue(float x, float y, float& outX, float& outY) const
//    {
//        outX = fmodf(2*x, 1.0f);
//        outY = (fabsf(2*x) + y)*0.5f;
//    }
//};

相关截图:

 

posted on 2014-09-15 13:54  叶飞影  阅读(814)  评论(0编辑  收藏  举报