Algorithm generates seven Awn stars

Source: Internet
Author: User

fantasy novels often have seven of the techniques of the star, this section on the use of algorithms to generate the next seven mans image. In the West, 7 is considered to be a magical number. God made men for 7 days and rested on the 7th day, and the revelation of the Bible had 7 seals, 7 candlesticks, 7th horns, and so on. But the magic symbols rarely see seven of the stars. But in the occult, the seven-star array is there, he contains a very powerful force, countless people are looking for and explore him, but the strength of the Seven Mans star, so that many people can not solve its mystery, which makes Seven Mans star has become a mystery. information on the seven Awn stars: 1. The Seven Mans star is difficult to be accurately drawn, because the Seven Mans star is an "uneven but stable one". The perfect seven-awn star is a very beautiful pattern, and can be drawn out by a stroke. The legend of a stroke of the perfect seven stars of the people said to see the blazing Archangel Michael, some said to see the Devil's Road West Law, also some people said to see the heaven Tree of Life. 2. The Seven Mans star is divided into "positive seven Mans star" and "Inverse Seven Mans star". However, it is difficult to distinguish between the "positive seven-star" and the "inverse seven-awn star", because there are many different ways of saying, one is to point to the position of the apex of the positive inverse, but the meaning of the representative of the five-star opposite; the other is that the positive judgment of the Seven Mans is just the opposite of the five-star, and some people think that the seven-awn star is not different from the pentagram. 3. There are also divergent opinions on the "seven-Star Magic Matrix". One of the seven vertices to be written by the mystery scholar is the name of seven Archangels, some say seven Duke's name, the other is the name of six elements (wind + fire + water + Earth four elements, plus light and dark), while the vacated top still represents "human emotion." There is also controversy about whether there is a ring outside the magic array. There should be a ring outside the magic array, but there is a saying that if you add a ring outside the seven-Star Magic Array, it will limit its strength and even destroy integrity, so you cannot draw on the ring. 4. The meaning of the seven mans is profound, and the strength of the Seven mans stars is unknown. But it is also because of the attraction of this mysterious search, also let a lot of people on his icon obsession, many people choose his icon as a totem, wearing left or right or tattooed on the body.
      Seven The power of the Magic matrix is not recorded much, only know probably can be used to summon. There is no way for a person to start a magical array, but if the magic array is launched, the summoned things are heavyweight, such as archangels or great demons, even unknown beings or forces. Don't be happy, these heavyweight guys don't bother to listen to a "lowly creature" 's wish, even if you can't even see their second eye, not because they can't see, but because the caller's ending will be miserable. It is said that there are several endings:
One, the summoner forgot everything. (best-known ending)
II. The Summoner is blinded by the glare. (better ending)
Iii. the summoner is insane. (at least alive)
Four, the Summoner was frightened to the dead. (There's a whole corpse)
V. the summoner is scorched, the Ripper is ripped, torn, broken and so on ...
Six, something swallows the summoner.
Seven, the summoner fell alive into hell.
Eight, the summoner disappears completely. (The corpse and the soul are gone) ------------------------------------

I previously sent an article that was "algorithm-generated N-awn", which also includes the seven-Awn star. In contrast to that, a chaotic approach is used to generate a seven-star image, which has a more profound and fractal effect.

Seven-star generation algorithm:

Mr. Cheng is a seven-angled 7 vertex, and a current point is set to the origin point;

A. Randomly select a vertex of a triangle to calculate its midpoint position with the current point;

B. Performing the calculated midpoint as the current point and re-executing action A

By iterating over millions, the pixel data of the seven-awn star chart can be generated.

The code is as follows:

int p[14];//seven vertices

for ( int i = 0; I < 7; i++)

      p[i*2+1] =-(int) (480*cos (I*2*PI/7));
}

unsigned int m_pixels_map[1024] [1024];//pixel data

         for (int n=0; n<count;n++)        {            int v=rand ()%7;            X+=p[v*2];            X/=2;            Y+=p[v*2+1];            Y/=2;             + +m_pixels_map[x][y];        }

The resulting image looks a bit mushy, but the magic of this image is that when you look away from the screen, the seven-Awn star will clearly show.

The following will make some changes to the seven-star algorithm to change the generation and use of random numbers, such as randomly selected vertices with a certain relationship with the current vertex as the next operation.

(1)

         for(intn=0; n<count;n++)        {            //do not take adjacent two pointsr = rand ()%5; if(r = =0) {v=C; }            Else{v= (c + R +1)%7; C=v; } x+=p[v*2]; X/=2; Y+=p[v*2+1]; Y/=2; ++M_pixels_map[x][y]; }

(2)

         for(intn=0; n<count;n++)        {            //do not take adjacent four pointsr = rand ()%3; if(r = =0) {v=C; }            Else{v= (c + R +2)%7; C=v; } x+=p[v*2]; X/=2; Y+=p[v*2+1]; Y/=2; ++M_pixels_map[x][y]; }

(3)

         for(intn=0; n<count/2; n++)        {            //do not take adjacent two pointsr = rand ()%5; if(r = =0) {v=C; }            Else{v= (c + R +1)%7; C=v; } x+=p[v*2]; X/=2; Y+=p[v*2+1]; Y/=2; ++M_pixels_map[x][y]; }         for(intn=0; n<count/2; n++)        {            //do not take adjacent four pointsr = rand ()%3; if(r = =0) {v=C; }            Else{v= (c + R +2)%7; C=v; } x+=p[v*2]; X/=2; Y+=p[v*2+1]; Y/=2; ++M_pixels_map[x][y]; }

(4)

         for(intn=0; n<count;n++)        {            //do not take the current pointr = rand ()%6; V= (c + R +1)%7; C=v; X+=p[v*2]; X/=2; Y+=p[v*2+1]; Y/=2; ++M_pixels_map[x][y]; }

(5)

         for(intn=0; n<count;n++)        {            //do not take the current point and two adjacent pointsr = rand ()%4; V= (c + R +2)%7; C=v; X+=p[v*2]; X/=2; Y+=p[v*2+1]; Y/=2; ++M_pixels_map[x][y]; }

Related articles:

Algorithm generates N-Mount star

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]

Algorithm generates seven Awn stars

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.