A few days ago the article "100 images generated by the program", incredibly no Taiji figure, this is how classic images. Therefore, the algorithm for generating Taiji figure is specifically described in this article. I've been writing about Tai Chi before. Mathematical graphics (1.23) The Taiji line, then hoped to be able to depict the shape of the Taiji figure in a curved way, but it was not very successful. The use of images, the generation of Taiji figure is relatively easy, first on the code:
1UnsignedintCpixeltaijiyinyang::calculatepixel (unsignedintX, unsignedinty)2 {3 floatRadius1 = m_params[0];4 floatRadius2 = radius1*m_params[1];5 6 floatRR = radius1*Radius1;7 8UnsignedintBlack =0xff000000;9UnsignedintWhite =0xFFFFFFFF;TenUnsignedintGray =0xff808080; One A floati =512.0f-x; - floatj =512.0f-y; - the if((I*i + j*j) >RR) - { - returnGray; - } + - floatT = j + radius1*0.5f; + floattt = t*t + i*i; A if(TT < radius2*radius2) at { - returnWhite ; - } - Else if(TT < rr*0.25f) - { - returnBlack; in } - tot = j-radius1*0.5f; +tt = t*t + i*i; - if(TT < radius2*radius2) the { * returnBlack; $ }Panax Notoginseng Else if(TT < rr*0.25f) - { the returnWhite ; + } A the if(I <0.0f) + { - returnWhite ; $ } $ Else - { - returnBlack; the } -}
Again
Software: Why mathematical image Generation tool, in which the outer ring radius and inner ring radius of the Taiji figure can be adjusted in the software as shown in:
Related articles:
The beauty of the algorithm---100 images generated by the program, there is always a piece that makes you feel amazing [top]
The beauty of the algorithm---100 images generated by the program, there is always a piece that makes you feel amazing [next]
An algorithm is used to generate a taiji figure