🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.programming
Article #205090

Re: Podpis cyfrowy większej ilości podmiotów

#205090
From: M.M.
Date: Thu, 18 Apr 2013 08:28
61 lines
3841 bytes
On Thursday, April 18, 2013 9:44:56 AM UTC+2, firr kenobi wrote:
> a czemu taka dziwna petla 
Nie wiem... znam akurat taką implementację rysowania
tego fraktala. Co jest w niej dziwne? Jaka jest lepsza?


>  for( i=0 ; i<inf ; i++ ) {
>       const double tmp = x*x - y*y + _x;
>       if( std::fabs(tmp) > 2.0 ) break;
>       y = 2.0 * x * y + _y;
>      if( std::fabs(y) > 2.0 ) break;
>      x = tmp;
>  }


> czy dwa warunki na fabsa sa szybsze 
> niz jeden na x*x+y*y>4. ? moze
> cztery x<-2, x>2 y<-2, y>2 bylyby szybsze 

Jak dwa warunki, jak cztery? Nie kumam :)

Teraz zrobiłem tak:

static unsigned int computeColor( const double _x, const double _y, const unsigned int inf ) {
	double x=0, y=0;
	unsigned int i;
	for( i=0 ; i<inf ; i++ ) {
		const double tmp = x*x - y*y + _x;
		y = 2.0 * x * y + _y;
		if( std::fabs(y) > 2.0 || std::fabs(tmp) > 2.0 ) break;
		x = tmp;
	}
	if( i==inf )
		return 0;
	return i * 255 / (inf-1);
}

I spadło jeszcze o 2 sekundy.

Tu cały kod rysowania:
http://pastebin.com/2tSWwMrr

Tutaj efekt z pomiarem czasu:
https://thumbs.rapidshare.com/thumbs/1024/D03/ED20DBD3BACA3EB9FAAD66E14301C.jpg

> wogole to proponuje liczyc na jaims ustalonym obszarze juz tamten 
> poprzedni -1,-1, 1,1, lepszy oraz wywalic dzielenia z petli
Na takim obszarze przy większej wartości inf mam wszystko czarne:
https://thumbs.rapidshare.com/thumbs/1024/F28/9A4A63B42170BFFB707E1970E39E1.jpg

Przy małym inf mam zbyt krótki czas i ciężko robić pomiary.

Robię na takim:
x1 = -1.40105941;
y1 = -0.00005182;
x2 = -1.40116832;
y2 = 0.00004030;
inf = 60000;


Pozdrawiam
Technical Details
Message-ID: <6f0c375b-de78-4b03-a0b4-c9e59f6f5786@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.85.212.215.MISMATCH!ma2no3560537wib.0!news-out.google.com!hg5ni16271wib.1!nntp.google.com!gp5no175495qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <kkdqot$5rl$1@node2.news.atman.pl> <kkdtr5$9n9$1@node1.news.atman.pl> <2795af88-99c6-4f35-8a9d-22bda8af2925@googlegroups.com> <kkec03$n4h$1@node2.news.atman.pl> <a9253e59-21f5-43b5-853a-c60cb43c1f15@googlegroups.com> <kkfd89$o9b$1@news.task.gda.pl> <0fff07bc-e341-49a0-810c-333536e2901a@googlegroups.com> <kkh42k$81t$1@news.task.gda.pl> <b177dfc7-88f3-4cd7-9075-2acdd76f9662@googlegroups.com> <kkhr56$a62$1@news.task.gda.pl> <30021d10-a471-4cae-8f17-61eb36cb775e@googlegroups.com> <kkkjpe$b54$1@news.task.gda.pl> <8b53662c-8c31-4fc3-b82b-8173d9cf4f6f@googlegroups.com> <47d7734e-680b-4e13-995e-c0a2407217c3@googlegroups.com> <cdced490-b579-41ee-a123-afb12010cc12@googlegroups.com> <kkmvfc$hu3$2@news.task.gda.pl> <d936ef81-4b63-4dcb-8771-cc2a1faab4e1@googlegroups.com> <d4359f15-51e4-438a-9057-b46d93bfc70c@googlegroups.com> <9f8703e3-4731-4da6-9e7a-0bf564f5896e@googlegroups.com>

Show Full Headers
Complete Article Headers
X-Received: by 10.180.75.82 with SMTP id a18mr3393309wiw.0.1366273725806;        Thu, 18 Apr 2013 01:28:45 -0700 (PDT)
X-Received: by 10.49.94.168 with SMTP id dd8mr1010783qeb.30.1366273725659; Thu, 18 Apr 2013 01:28:45 -0700 (PDT)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.85.212.215.MISMATCH!ma2no3560537wib.0!news-out.google.com!hg5ni16271wib.1!nntp.google.com!gp5no175495qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.programming
Date: Thu, 18 Apr 2013 01:28:45 -0700 (PDT)
In-Reply-To: <9f8703e3-4731-4da6-9e7a-0bf564f5896e@googlegroups.com>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=213.195.164.27; posting-account=xjvq9QoAAAATMPC2X3btlHd_LkaJo_rj
NNTP-Posting-Host: 213.195.164.27
References: <kkdqot$5rl$1@node2.news.atman.pl> <kkdtr5$9n9$1@node1.news.atman.pl> <2795af88-99c6-4f35-8a9d-22bda8af2925@googlegroups.com> <kkec03$n4h$1@node2.news.atman.pl> <a9253e59-21f5-43b5-853a-c60cb43c1f15@googlegroups.com> <kkfd89$o9b$1@news.task.gda.pl> <0fff07bc-e341-49a0-810c-333536e2901a@googlegroups.com> <kkh42k$81t$1@news.task.gda.pl> <b177dfc7-88f3-4cd7-9075-2acdd76f9662@googlegroups.com> <kkhr56$a62$1@news.task.gda.pl> <30021d10-a471-4cae-8f17-61eb36cb775e@googlegroups.com> <kkkjpe$b54$1@news.task.gda.pl> <8b53662c-8c31-4fc3-b82b-8173d9cf4f6f@googlegroups.com> <47d7734e-680b-4e13-995e-c0a2407217c3@googlegroups.com> <cdced490-b579-41ee-a123-afb12010cc12@googlegroups.com> <kkmvfc$hu3$2@news.task.gda.pl> <d936ef81-4b63-4dcb-8771-cc2a1faab4e1@googlegroups.com> <d4359f15-51e4-438a-9057-b46d93bfc70c@googlegroups.com> <9f8703e3-4731-4da6-9e7a-0bf564f5896e@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6f0c375b-de78-4b03-a0b4-c9e59f6f5786@googlegroups.com>
Subject: Re: Podpis cyfrowy
 większej ilości podmiotów
From: "M.M." <mmarszik@gmail.com>
Injection-Date: Thu, 18 Apr 2013 08:28:45 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit