KR102091501B1 - 카오스패턴생성방법 - Google Patents

카오스패턴생성방법 Download PDF

Info

Publication number
KR102091501B1
KR102091501B1 KR1020150102200A KR20150102200A KR102091501B1 KR 102091501 B1 KR102091501 B1 KR 102091501B1 KR 1020150102200 A KR1020150102200 A KR 1020150102200A KR 20150102200 A KR20150102200 A KR 20150102200A KR 102091501 B1 KR102091501 B1 KR 102091501B1
Authority
KR
South Korea
Prior art keywords
int
double
value
void
red
Prior art date
Application number
KR1020150102200A
Other languages
English (en)
Other versions
KR20170010495A (ko
Inventor
김성춘
정호선
Original Assignee
김성춘
정호선
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 김성춘, 정호선 filed Critical 김성춘
Priority to KR1020150102200A priority Critical patent/KR102091501B1/ko
Publication of KR20170010495A publication Critical patent/KR20170010495A/ko
Application granted granted Critical
Publication of KR102091501B1 publication Critical patent/KR102091501B1/ko

Links

Classifications

    • DTEXTILES; PAPER
    • D06TREATMENT OF TEXTILES OR THE LIKE; LAUNDERING; FLEXIBLE MATERIALS NOT OTHERWISE PROVIDED FOR
    • D06CFINISHING, DRESSING, TENTERING OR STRETCHING TEXTILE FABRICS
    • D06C23/00Making patterns or designs on fabrics
    • DTEXTILES; PAPER
    • D06TREATMENT OF TEXTILES OR THE LIKE; LAUNDERING; FLEXIBLE MATERIALS NOT OTHERWISE PROVIDED FOR
    • D06QDECORATING TEXTILES
    • D06Q1/00Decorating textiles
    • DTEXTILES; PAPER
    • D06TREATMENT OF TEXTILES OR THE LIKE; LAUNDERING; FLEXIBLE MATERIALS NOT OTHERWISE PROVIDED FOR
    • D06CFINISHING, DRESSING, TENTERING OR STRETCHING TEXTILE FABRICS
    • D06C2700/00Finishing or decoration of textile materials, except for bleaching, dyeing, printing, mercerising, washing or fulling
    • D06C2700/31Methods for making patterns on fabrics, e.g. by application of powder dye, moiréing, embossing

Landscapes

  • Engineering & Computer Science (AREA)
  • Textile Engineering (AREA)
  • Processing Or Creating Images (AREA)

Abstract

본 발명은 z=z*z+c(z=x+iy, c=a+ib)를 만족하고 복소평면의 점들의 모임인 만델브로트 집합(이때, 점 C는 이 복소 평면상에서 무한대로 발산하지 않는 점들의 모임)과 고정된 C 값에 대하여 만델브로트 방정식에서 발생된 점들의 모임인 줄리아 집합으로 이루어진 카오스패턴을 생성하는 카오스패턴생성방법에 있어서, 상기 z=z*z+c(z=x+iy, c=a+ib)에서, z의 초기값을 z=0+0i로 하여 점화식을 반복하여 계산하고; c값에 따라 z가 하나의 값으로 수렴하고 여러 값 사이를 순환적으로 맴돌기도 하고 아주 큰 값으로 발산하며; 파이겐바움 분기도 x=ax(1-x)에서 x의 초기값을 0.2로 하고 점화식을 반복할 때, x는 a의 값에 따라 수렴하고, 여러 값 사이를 순환적으로 움직이기도 하고 카오스적인 값이 반복되며; 만델브로트 집합에서 마찬가지로 z=0+0i로 점화식을 계속 반복하여 계산하고 c값에 따라 z가 하나의 값으로 수렴하고 여러 값 사이를 순환적으로 맴돌고 큰 값으로 발산하며, 만델브로트 집합은 z의 초기값을 z=0+0i 으로 하였을 때, z=z*z+c를 발산시키지 않는 복소수 c들의 모임인 것을 특징으로 한다.

Description

카오스패턴생성방법{the method for generating chaos pattern}
본 발명은 카오스패턴 생성방법에 관한 것으로, 더 상세하게는 의류, 가방, 신발 등의 패션제품의 무늬로 이용하기 위해서 만델브로트 집합과 줄리아 집합으로 구성된 카오스패턴을 생성하기 위한 카오스패턴생성방법에 관한 것이다.
등록특허 10-1206290호(직물패턴 알고리즘 적용을 통한 품질검사 장치 및 그 제어방법)에 따르면, "직물패턴 알고리즘 적용을 통한 품질검사 장치 및 그 제어방법에 관한 것이다. 본 발명의 일예와 관련된 품질 검사 장치는 기준 영상을 입력 받기 위한 사용자 입력부, 적어도 하나의 객체에 대한 제 1 영상을 연속하여 획득하기 위한 스캔 카메라와 기 설정된 알고리즘에 따라 상기 기준 영상 및 제 1 영상을 이용하여 상기 적어도 하나의 객체에 손상이 있는지 여부를 판단하는 제어부를 포함하되, 상기 기준 영상과 상기 제 1 영상을 비교한 결과가 기 설정된 범위를 초과하는 경우, 상기 제어부는 상기 제 1 영상이 상기 기준 영상으로 변경되어 설정되도록 제어할 수 있다."라고 개시된 바가 있다.
등록특허 10-1206290호(직물패턴 알고리즘 적용을 통한 품질검사 장치 및 그 제어방법)
그러나, 종래의 직물패턴은 스캐닝방식에 의한 것으로, 일차적인 디자인을 추출하는 것이어서 새로운 패턴을 생성하기가 어려운 단점이 있다.
본 발명은 변수를 변경하는 것만으로도 다양한 패턴을 생성할 수 있는 카오스패턴 생성방법을 제공하는데 그 목적이 있다.
상기 목적을 달성하기 위한 본 발명은 z=z*z+c(z=x+iy, c=a+ib)를 만족하고 복소평면의 점들의 모임인 만델브로트 집합(이때, 점 C는 이 복소 평면상에서 무한대로 발산하지 않는 점들의 모임)과 고정된 C 값에 대하여 만델브로트 방정식에서 발생된 점들의 모임인 줄리아 집합으로 이루어진 카오스패턴을 생성하는 카오스패턴생성방법에 있어서, 상기 z=z*z+c(z=x+iy, c=a+ib)에서, z의 초기값을 z=0+0i로 하여 점화식을 반복하여 계산하고; c값에 따라 z가 하나의 값으로 수렴하고 여러 값 사이를 순환적으로 맴돌기도 하고 아주 큰 값으로 발산하며; 파이겐바움 분기도 x=ax(1-x)에서 x의 초기값을 0.2로 하고 점화식을 반복할 때, x는 a의 값에 따라 수렴하고, 여러 값 사이를 순환적으로 움직이기도 하고 카오스적인 값이 반복되며; 만델브로트 집합에서 마찬가지로 z=0+0i로 점화식을 계속 반복하여 계산하고 c값에 따라 z가 하나의 값으로 수렴하고 여러 값 사이를 순환적으로 맴돌고 큰 값으로 발산하며, 만델브로트 집합은 z의 초기값을 z=0+0i 으로 하였을 때, z=z*z+c를 발산시키지 않는 복소수 c들의 모임인 것을 특징으로 한다.
본 발명의 바람직한 효과에 따르면, 특별한 창의성이 요구되지 않으면서도 단지 변수를 조정하거나 변경하는 것만으로도 여러 가지 패턴을 간편하게 생성할 수 있는 장점이 있다.
이하, 본 발명에 따른 카오스패턴의 생성방법을 살펴보면 다음과 같다.
본 발명의 카오스패턴은 만델브로트 연산식, 줄리아 연산식을 계산하는 컴퓨터프로그램에 의해서 생성하는데, 이를 상세히 설명하면 다음과 같다.
만델브로트 집합은 다음 점화식으로 정의된 수열이 발산하지 않는 성질을 갖도록 하는 복소수 c의 집합으로 정의된다.
z0 = 0 (단, zn은 복소수.)
zn+1 = zn2 + c
이를 복소수를 사용하지 않고 정의하려면 모든 복소수를 실수부와 허수부로 나누면 된다. 만약 zn을 (xn,yn)로, c를 (a,b)로 바꾸면 위 식은 다음과 같이 된다.
(x0,y0)=(0,0)
xn+1 = xn2 - yn2 + a
yn+1 = 2 xn yn + b (단, xn,yn,a,b는 실수)가 된다.
이 집합의 이름은 이를 고안한 프랑스의 수학자 브누아 만델브로의 이름을 따라 만들어졌는데, 영어표기를 따라서 만델브로트 집합이라 불리기도 한다.
수학적인 의미에서 만델브로트 집합을 그린다면 집합 안의 부분과 밖의 부분 두 가지만 의미가 있으며 단 두 가지 색으로도 충분하다. 하지만 많은 프랙탈 생성 소프트웨어에서는 처음으로 경계값을 벗어난 zn의 n값에 따라 만델브로트 집합 바깥의 영역을 다른 색으로 칠한다. 오른쪽 그림의 경우 가장 빨리 발산하는 점은 검정색으로, 그리고 발산속도가 느려질 수록 더욱더 밝은색으로 칠해졌다. 이론적으로 발산속도가 늦어질수록 그 c값은 만델브로 집합에 가깝다는 뜻이며 이를 시각적으로 알 수 있다.
만델브로트 집합은 줄리아 집합(Julia set)의 일종의 "지도"가 된다. 만델브로트가 그려지는 복소평면의 각 점이 줄리아 집합의 초기값과 일대일 대응이 될 수 있는데, 만델브로트 집합 내부의 점에 대응하는 줄리아 집합은 연결된(connected)것 인 반면, 바깥의 점들은 연결되지 않은(disconnected) 것인 줄리아 집합에 대응하기 때문이다.
이러한 만델브로트 집합, 줄리아 집합을 해석하고 설명해보도록 한다.
z=z*z+c(z=x+iy, c=a+ib)
z의 초기값을 z=0+0i로 하여 점화식을 반복하여 계산한다.
그 결과는 c값에 의존한다. 즉 c값에 따라 z가 하나의 값으로 수렴하기도 하고 여러 값 사이를 순환적으로 맴돌기도 하고 아주 큰 값으로 발산하기도 한다. 만델브로트 집합은 초기값을 z=0+0i로 했을때 z=z*z+c을 발산시키지 않는 복소수 c들의 모임이다.
파이겐바움 분기도 x=ax(1-x)에서 x의 초기값을 0.2로 하고 점화식을 반복할 때, x는 a의 값에 따라 수렴하기도 하고, 여러 값 사이를 순환적으로 움직이기도 하고 카오스적인 값이 반복되기도 한다.
만델브로트 집합에서 마찬가지로 z=0+0i로 점화식을 계속 반복하여 계산하고 c값에 따라 z가 하나의 값으로 수렴하기도 하고 여러 값 사이를 순환적으로 맴돌기도 하고 큰 값으로 발산하기도 한다. 만델브로트 집합은 z의 초기값을 z=0+0i 으로 하였을 때, z=z*z+c를 발산시키지 않는 복소수 c들의 모임이다.
이러한 집합의 발산, 수렴, 순환을 살펴보자.
z*z+c=(x+iy)*(x+iy)+a+ib
= (x*x-y*y+i2xy)+a+ib
= (x*x-y*y+a)+i(2xy+b)이므로
x+iy=(x*x-y*y+a)+i(2xy+b) 따라서
x=x*x-y*y+a, y=2xy+b
임의의 (a,b)를 만델브로트 공식에 대입한다.
-2에서 2의 범위 하에서 c값을 임의로 한점 정한다.
만일 그 값이 x,y축의 원점을 중심으로 반경2의 범위내에 있다면 검은색으로 칠하고 그 밖에 있다면 흰색으로 칠하자.이렇게 해서 구성된 것이 만델부르트의 우물이다.
이것은 다음과 같이 정리할 수 있다.
1.(x,y)평면상에 원점을 중심으로 하는 반경2의 원을 그려라. (z = 0+i0)
2.-2에서 2사이의 임의의 점(a,b)를 취하라.
3.계산의 최대횟수를 정하라.
4.(a,b)를 변환기에 넣어 계산을 수행하라.
5.만일 허용된 횟수 안에 범위를 벗어나지 않는다면 검은 색으로 칠하라.
6.범위 밖으로 벗어난다면 색으로 칠하라.(사실 이것은 단순화시킨 것이며 만델브로트 우물을 만들 때는 탈출속도에 따라 다른 색을 부여한다. 물론 색의 부여는 전적으로 임의적인 것이다.)
앞의 사례에서 6회째 계산에서 그것이 반경2의 범위 내에 있는 것을 확인할 수 있었지만 경우에 따라서는 지금까지의 계산으로는 범위 내에 있다고 해도 계산횟수를 늘여가면 그 범위를 넘어가 버릴지도 모른다. 사실 회수를 늘여갈수록 검은 부위는 둥그런 형태에서 잘룩한 허리를 가진 형태로 변해간다.
Iterations of real function xn+1 = f( xn ) = xn2 + c
이번에 보이는 예제는, -2 < x,y < 2범위에서 f oN(x) = f(f(...f(x)))는 파란 곡선, y=x는 푸른색의 직선으로 나타난다.
상수 c는 y(0) = f(0) = C이므로 y절편과 만나는 점이다. n에 대응하는 변수 xn은 아래에 그려진다.
그러면, 만델브로트 집합과 반복을 살펴보자.
만델브로트 집합은 복소수 z와 c로 이루어진 함수의 반복으로 이루어진 값으로 구성된다.
zm+1 = f( zm ) = zm2 + c or
fc: zo -> z1 -> z2 -> ...
점 z0를 시작점으로 반복한다.
실수 c와 z0로, zm은 실수가 되고, 2차 평면(x,y)에서 반복하는 값을 그릴 수 있다. 1회 반복한 값을 그리기 위해, x0=0에서 수직으로 붉은 선을 y = f(x) = x2 + c 파란 곡선의 y1 = f(xo) = c 방향으로 그린다.
2회 반복한 값을 얻기 위해, y = x 녹색직선의 x1 = y1 = f(xo)을 향해 붉은 선을 수평으로 그린다. 그런 후에 파란 곡선의 y2 = f(x1)으로 수직방향으로 향하게 한다. m에 대응하는 변수 xm은 우측에 나타난다. c와 x0에 의해 fc: xo -> x1 -> x2 -> ... 점들은 x0의 궤적을 만든다.
25회 반복 이후는 고정되는 점 x* = f(x*)에 근사하게 된다. 고정되는 점은 y = x와 y = f(x)의 교점과 일치한다.이차방정식은 두개의 근이 있기 때문에 항상 두 고정점이 존재한다. 두번째 근은 무시한다.
변수 c에 의해 방정식 근이 허수가 된다. c > 1/4에서 고정점은 무시된다. 무한 반복하게 된다. |zn| > 2이면, 무한 궤적이 된다. 이러한 반복구간에서 성질상의 변화를 분기라 한다.
c=-0.75에서는 고정점이 무시되고, 반복함에 따라 x1 -> x2 -> x1 ... 인 2주기의 궤적에 근사한다.
f(로지스틱 분기 맵과 유사한)의 분기 다이어그램에 의한 (x,c)평면은 수렴하는 궤적 주기의 분기를 나타내는 좋은 방법이다.평면 (x, c)에서 모든 실수 c에 대해 fc: xo = 0 -> x1 -> x2 ->...-> xMax로 반복해서 그려라.여러 색(파란색부터 붉은 색까지)은 궤적이 얼마나 자주 픽셀을 만났는지 보여준다. (확대상황에 따라 색은 변한다.)
우측 그림의 c값에 부합하는 함수 fc(x)의 반복함수를 볼 수있다.
그림은 -3/4 < c < 1/4에서의 단일 근사 고정점f와 일치한다. c > 1/4에서의 점은 +무한대로 발산한다.
거미줄과 넓게 퍼지는 것은 임계 궤적점이 어떻게 고정점으로 근사하는가를 보여준다. c ~ -3/4에서 분기되는 점들을 볼 수 있다.
분기 다이어그램의 낮은 영역에서 혼돈영역과 주기력 스펙트럼대의 하얗고 협소한 공간을 본다. 가장 낮고 가장 큰 값은 3주기 스펙트럼대와 일치한다.
여기서, 분기맵 패턴을 살펴본다.
혼돈 궤적 점들의 분포에서 표면이 매핑 최종단계에 의해 일반화 된다.
그러므로 분기 다이어그램의 특이점들(붉은색으로 그려진)은 변곡점 fc on(0)에서 나타난다.
gn(c) = fcon(0)로 정의하면,
go(c) = 0, g1(c) = c, g2(c) = c2 + c, ... 이 된다.
곡선 g0,1,...,6(c)로 나타난다.
그러면, 2차 만델브로트 집합과 줄리아 집합을 평면위에 그려본다.
'2차 만델브로트 집합 + 줄리아집합'을 평면 (xo , c)에 그리기 위해, xo로 부터 시작하여, 변수 c를 xn+1 = xn2 + c를 이용하여 반복하여 변환한다.(반복 횟수는 정해둔다.)
만약, |xn| > 2의 조건이 되면 중단한다. 반복이 끝나면, 점은 만델브로트 + 줄리아집합(검은색 영역) 안쪽범위에 있다. 만약 중단하면, 점은 바깥영역에 있고, 얼마나 많은 반복회 수 후에 완료되었는지에 따라 색을 띄게 된다.
Y절편은 변수 c값과 일치하고, X절편은 변수 시작점 xo와 일치한다.
만델브로트 집합(M)은 zn+1 = zn2 + c이 무한으로 가지 않는 것 같은 복소수 영역의 모든 점 c의 집합이다.
복소수 영역 z에서 점은 c로 고정된 반복함수 fc하에서 Fatou 집합형태로 수렴한다. 줄리아집합(J)는 이것을 보충한 것이다.
그러므로 줄리아 집합은 모든 버려지는 고정점, 주기궤적 등을 포함한다.
만델브로트 집합은 검은색 영역으로 표시된다. M집합에서 바깥영역의 점들은 |zn| > 2이 되기 전에 반복한 횟수에 따라 색깔이 지정된다.
만델브로트 집합에서 각 점 c는 줄리아 집합에 해당하는 기하학 구조를 명기한다. 만약 c가 만델브로트 집합에 있다면, 줄리아 집합에서 연결된다. 만약 c가 만델브로트 집합에 있지 않다면, 줄리아 집합은 Cantor dust이다.
줄리아 집합은 f(z)가 우함수 이므로 확실히 좌우대칭 구조이다.
만델브로트 집합에서 c1 = -0.71 + 0.1i을 위한 connected 줄리아 집합은 다음과 같이 보여진다. 줄리아 집합은 왼쪽 그림의 색이 주어진 부분과 검은 영역사이의 기준이 된다.고정점 z1에 근접하기 위해 포함하는, z = 0에서 시작하는 궤적이 또한 보여진다.
"Filled" 줄리아 집합 "f"라 명명한다. connected 줄리아 집합의 내부에 있는 색들이 빠르게 점이 표시되고, f -on(z1)의 근사값과 무한 연속값이 표시된다.
이것은 "Douady's rabbit"이다. 흰색 삼각형은 f: z1 -> z2 -> z3 -> z1인 3궤도-주기로 근사하는 orbit star를 보여준다.
이 순환은 줄리아 집합 내부의 n=3 구성요소에 놓여져있다. 게다가, n구성요소들은 한점에 같이 결합된다. 근사하는 순환은 fc가 반복함에 따라 n 구성요소들 사이에서 짧게 움직인다.
왼쪽에는 Cantor dust가 표시되고, 오른쪽에는 "dendrite"이 표시된다.
줄리아 집합 J(C)는 반복하는 하에서 수렴(또는 무한)으로 가지 않는 점 z로 구성되어진다. 점 y = fc(z) = z2 + c 반복이 수렴하지 않는다는 것은 명백하다.
그러므로 줄리아 집합은 fc하에서 불변이다.
이것은 c = 0 + 0i를 위한 가장 기본적인 줄리아 집합이다.
왜냐하면 | zo | < 1에서 zn은 고정점 z=0를 포함한다.
| zo | > 1에서, zn은 무한대로 간다.
| zo | = 1에서, zn은 | z | = 1에 머문다.
원이 줄리아 집합 J(0)이고, 원이 fo = z2하에서 불변이다.
전체 영역 J(-1)에서 절반인 Re(z) > 0(또는 Im(z) > 0)에서 J(-1)의 점들이 어떻게 위치하는지 상상해보는 것은 어렵지 않다. 정방에서 J(-1)은 오른쪽으로 움직이고, 후에 c=-1의 추가로, 줄리아 집합은 원 위치로 돌아온다. 주목할 것은 두 점 a가 a'로 위치되어 진다.
게다가 c = -1.77289을 위해, 비슷한 방법으로 z = 0에 위치한 가장 큰 J(-1)극소점은 작은 곳에 위치하게 된다.
"cauliflower" J(0.35)집합은 "squaring" 대칭과 같은 것을 갖고 있는 것을 알기 쉽다.
아래에서 Douady rabbit을 위해 변환을 사각으로 표현한다. R-R선은 대칭부분이 마주보도록 절반으로 자른다. 그리고 각 부분은 fc에 의해 줄리아 집합에서 이동하게 된다. 두 점 R은 R'로 이동된다. 정사각형은 원 대신에 사용된다.
f는 z1을 z2로 움직이게 한다. 즉, z2 = f(z1). 충분히 작은 값 e이 있으면, f(z1+e) = f(z1) + f '(z1) + O(e 2) = z2 + k e + O(e 2), k = f '(z1).
그러므로, (z1 + e)이 줄리아 집합에 있으면, (z2 + k e)또한 존재한다. k는 0이 아니다. 그러므로 z2의 이웃은 z1의 이웃과 유사하다. 따라서 이전 영상에서 반복된f o(-n)(z1) 과 후에 나타난f on(z1) 은 줄리아 집합에서 항상 밀집되어 진다 .그러므로 줄리아 집합은 모든 점에서 self-similalar이다.
만델브로트에 의한 프로그램을 작성하고, 이를 수행한 결과를 살펴본다.
만델브로트의 초기치 및 반복 횟수에 따른 결과는 다음과 같다.
초기치 : z0 = x0+y0i 및 반복횟수
z=0+0i (100회)
z=0.5+0i (16회)
z=0+0.5i (100회)
z=0.9+0i (100회)
z=0+0.9i (100회)
z=1.5+0i (100회)
z=0-0.6i (100회)
z=-0.5-0.5i (100회)
z=0.123-0.745i (100회)
만델브로트 center x=-1.45,y=-0.02 and x와 y의 좌표간 간격 0.005,0.005
center x=-1.45,y=-0.02 and x와 y의 좌표간 간격 0.0025,0.0025
center x=-1.45,y=-0.02 and x와 y의 좌표간 간격 0.00125,0.00125
center x=-1.45,y=-0.02 and x와 y의 좌표간 간격 0.000625,0.000625
center x=-1.74,y=-0.02 and x와 y의 좌표간 간격 0.002,0.002
center x=-1.87,y=0 and x와 y의 좌표간 간격 0.001,0.001
center x=-1.93,y=-0.0045 and x와 y의 좌표간 간격 0.0005,0.0005
center x=-1.93,y=-0.0045 and x와 y의 좌표간 간격 0.0005,0.0005
z=0.5+0i
center x=-1.973,y=-0.001 and x와 y의 좌표간 간격 0.00025,0.00025
center x=-0.12,y=-0.025 and x와 y의 좌표간 간격 0.0025,0.0025
center x=-1.51,y=-0.96 and x와 y의 좌표간 간격 0.00125,0.00125
center x=-0.124,y=-1.022and x와 y의 좌표간 간격 0.00025,0.00025
center x=-1.577,y=-1.033 and x와 y의 좌표간 간격 8.33,8.33
center x=-1.647,y=-1.038 and x와 y의 좌표간 간격 2.78,2.78
center x=-1.647,y=-1.04 and x와 y의 좌표간 간격 5.56,5.56
만델브로트 프로그램으로 다음과 같은 옵션으로 카오스패턴을 생성할 수 있다.
1. 중심에서 각도를 가변한 그림
2. 만델브로트 수렴 영역을 real, image값, 절대값, cos, sin값에 따른 다양한 색 표현
3. 만델브로트 발산 영역의 다양한 색 표현
4. 만델브로트 결과를 초기치로 하여 표현한 줄리아 그림
5. z=z^3+c
6. z=z^4+c
7. z=z^5+c
8. z=z^6+c
1. angle 50
angle 80
2. incolor : real/image
incolor : abs(abs(c)-abs(r))
incolor : cos(mag)
incolor : mag*cos(real^2)
incolor : sin(real^2-img^2)
3. outcolor
4. 만델브로트 결과값을 초기치로 하여 표현한 줄리아 그림
5. z=z^3+c
6. z=z^4+c
7. z=z^5+c
8. z=z^6+c
또한, 다음과 같이 줄리아의 초기치 및 반복횟수에 따른 프로그램 수행 결과를 예시할 수 있다.
줄리아 집합
c=0.123-0.745i (100회)
c=0+0i (100회)
c=0.1+0i (100회)
c=-0.1-0i (100회)
c=-0.1+0.1i (100회)
c=-0.1-0.2i (100회)
c=-0.2-0.5i (100회)
c=-0.5-0.5i (100회)
c=-0.5-0.7i (100회)
c=-0.5+0.7i (100회)
c=0.5+0.7i (100회)
그리고, 줄리아의 초기치 및 확대 프로그램 수행 결과를 다음과 같이 예시할 수 있다.
c=-0.123+0.745i/ center (0.055,-0.78)/x와 y의 좌표간 간격 0.002,0.002
c=-0.123+0.745i/ center (-0.023,-0.87)/x와 y의 좌표간 간격 0.0004,0.0004
c=-0.123+0.745i/ center (-0.08992,-0.87)/x와 y의 좌표간 간격 000133,0.000133
c=-0.123+0.745i/ center (-0.0852,-0.9)/x와 y의 좌표간 간격 6.6666,6.6666
c=-0.123+0.745i/ center (-0.0893,-0.903)
x와 y의 좌표간 간격 2.2222,2.2222
c=-0.123+0.745i/ center (-0.0904,-0.904)/x와 y의 좌표간 간격 3.175,3.175
c=-0.123+0.745i/ center (-0.0906,-0.904)/x와 y의 좌표간 간격 7.937,7.937
위와같은 만델브로트 줄리아 프로그램 환경과 소스코드를 예시하면 다음과 같다.
[프로그램 환경 및 Header file]
1. linux gcc compiler 사용
2. pngwriter group의 header를 이용하여 그래프 구현
//********** pngwriter.h **********************************************
// Description: Library that allows plotting a 48 bit
// PNG image pixel by pixel, which can
// then be opened with a graphics program.
// License: GNU General Public License
#ifndef PNGWRITER_H
#define PNGWRITER_H 1
#define PNGWRITER_VERSION 0.53
#include <png.h>
// REMEMBER TO ADD -DNO_FREETYPE TO YOUR COMPILATION FLAGS IF PNGwriter WAS
// COMPILED WITHOUT FREETYPE SUPPORT!!!
// RECUERDA AGREGAR -DNO_FREETYPE A TUS OPCIONES DE COMPILACION SI PNGwriter
// FUE COMPILADO SIN SOPORTE PARA FREETYPE!!!
#ifndef NO_FREETYPE
#include <ft2build.h>
#include FT_FREETYPE_H
#endif
#ifdef OLD_CPP // For compatibility with older compilers.
#include <iostream.h>
#include <math.h>
#include <wchar.h>
#include <string.h>
using namespace std;
#endif // from ifdef OLD_CPP
#ifndef OLD_CPP // Default situation.
#include <iostream>
#include <cmath>
#include <cwchar>
#include <string>
#endif // from ifndef OLD_CPP
//png.h must be included before FreeType headers.
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>
#define PNG_BYTES_TO_CHECK (4)
#define PNGWRITER_DEFAULT_COMPRESSION (6)
class pngwriter
{
private:
char * filename_;
char * textauthor_;
char * textdescription_;
char * texttitle_;
char * textsoftware_;
int height_;
int width_;
int backgroundcolour_;
int bit_depth_;
int rowbytes_;
int colortype_;
int compressionlevel_;
unsigned char * * graph_;
double filegamma_;
double screengamma_;
void circle_aux(int xcentre, int ycentre, int x, int y, int red, int green, int blue);
void circle_aux_blend(int xcentre, int ycentre, int x, int y, double opacity, int red, int green, int blue);
int check_if_png(char *file_name, FILE **fp);
int read_png_info(FILE *fp, png_structp *png_ptr, png_infop *info_ptr);
int read_png_image(FILE *fp, png_structp png_ptr, png_infop info_ptr,
png_bytepp *image, png_uint_32 *width, png_uint_32 *height);
void flood_fill_internal( int xstart, int ystart, double start_red, double start_green, double start_blue, double fill_red, double fill_green, double fill_blue);
void flood_fill_internal_blend( int xstart, int ystart, double opacity, double start_red, double start_green, double start_blue, double fill_red, double fill_green, double fill_blue);
#ifndef NO_FREETYPE
void my_draw_bitmap( FT_Bitmap * bitmap, int x, int y, double red, double green, double blue);
void my_draw_bitmap_blend( FT_Bitmap * bitmap, int x, int y,double opacity, double red, double green, double blue);
#endif
/* The algorithms HSVtoRGB and RGBtoHSV were found at http://www.cs.rit.edu/~ncs/
* which is a page that belongs to Nan C. Schaller, though
* these algorithms appear to be the work of Eugene Vishnevsky.
* */
void HSVtoRGB( double *r, double *g, double *b, double h, double s, double v );
void RGBtoHSV( float r, float g, float b, float *h, float *s, float *v );
/* drwatop(), drawbottom() and filledtriangle() were contributed by Gurkan Sengun
* ( <gurkan@linuks.mine.nu>, http://www.linuks.mine.nu/ )
* */
void drawtop(long x1,long y1,long x2,long y2,long x3, int red, int green, int blue);
void drawbottom(long x1,long y1,long x2,long x3,long y3, int red, int green, int blue);
void drawbottom_blend(long x1,long y1,long x2,long x3,long y3, double opacity, int red, int green, int blue);
void drawtop_blend(long x1,long y1,long x2,long y2,long x3, double opacity, int red, int green, int blue);
public:
/* General Notes
* It is important to remember that all functions that accept an argument of type "const char *" will also
* accept "char *", this is done so you can have a changing filename (to make many PNG images in series
* with a different name, for example), and to allow you to use string type objects which can be easily
* turned into const char * (if theString is an object of type string, then it can be used as a const char *
* by saying theString.c_str()).
* It is also important to remember that whenever a function has a colour coeffiecient as its argument,
* that argument can be either an int from 0 to 65535 or a double from 0.0 to 1.0.
* It is important to make sure that you are calling the function with the type that you want.
* Remember that 1 is an int, while 1.0 is a double, and will thus determine what version of the function
* will be used. Similarly, do not make the mistake of calling for example plot(x, y, 0.0, 0.0, 65535),
* because
* there is no plot(int, int, double, double, int).
* Also, please note that plot() and read() (and the functions that use them internally)
* are protected against entering, for example, a colour coefficient that is over 65535
* or over 1.0. Similarly, they are protected against negative coefficients. read() will return 0
* when called outside the image range. This is actually useful as zero-padding should you need it.
* */
/* Compilation
* A typical compilation would look like this:
*
* g++ my_program.cc -o my_program freetype-config --cflags
* -I/usr/local/include -L/usr/local/lib -lpng -lpngwriter -lz -lfreetype
* If you did not compile PNGwriter with FreeType support, then remove the
* FreeType-related flags and add -DNO_FREETYPE above.
* */
/* Constructor
* The constructor requires the width and the height of the image, the background colour for the
* image and the filename of the file (a pointer or simple "myfile.png"). The background colour
* can only be initialized to a shade of grey (once the object has been created you can do whatever
* you want, though), because generally one wants either a white (65535 or 1.0) or a black (0 or 0.0)
* background to start with.
* The default constructor creates a PNGwriter instance that is 250x250, white background,
* and filename "out.png".
* Tip: The filename can be given as easily as:
* pngwriter mypng(300, 300, 0.0, "myfile.png");
* Tip: If you are going to create a PNGwriter instance for reading in a file that already exists,
* then width and height can be 1 pixel, and the size will be automatically adjusted once you use
* readfromfile().
* */
pngwriter();
pngwriter(const pngwriter &rhs);
pngwriter(int width, int height, int backgroundcolour, char * filename);
pngwriter(int width, int height, double backgroundcolour, char * filename);
pngwriter(int width, int height, int backgroundcolour, const char * filename);
pngwriter(int width, int height, double backgroundcolour, const char * filename);
/* Destructor
* */
~pngwriter();
/* Assignment Operator
* */
pngwriter & operator = (const pngwriter & rhs);
/* Plot
* With this function a pixel at coordinates (x, y) can be set to the desired colour.
* The pixels are numbered starting from (1, 1) and go to (width, height).
* As with most functions in PNGwriter, it has been overloaded to accept either int arguments
* for the colour coefficients, or those of type double. If they are of type int,
* they go from 0 to 65535. If they are of type double, they go from 0.0 to 1.0.
* Tip: To plot using red, then specify plot(x, y, 1.0, 0.0, 0.0). To make pink,
* just add a constant value to all three coefficients, like this:
* plot(x, y, 1.0, 0.4, 0.4).
* Tip: If nothing is being plotted to your PNG file, make sure that you remember
* to close() the instance before your program is finished, and that the x and y position
* is actually within the bounds of your image. If either is not, then PNGwriter will
* not complain-- it is up to you to check for this!
* Tip: If you try to plot with a colour coefficient out of range, a maximum or minimum
* coefficient will be assumed, according to the given coefficient. For example, attempting
* to plot plot(x, y, 1.0,-0.2,3.7) will set the green coefficient to 0 and the red coefficient
* to 1.0.
* */
void plot(int x, int y, int red, int green, int blue);
void plot(int x, int y, double red, double green, double blue);
/* Plot HSV
* With this function a pixel at coordinates (x, y) can be set to the desired colour,
* but with the colour coefficients given in the Hue, Saturation, Value colourspace.
* This has the advantage that one can determine the colour that will be plotted with
* only one parameter, the Hue. The colour coefficients must go from 0 to 65535 and
* be of type int, or be of type double and go from 0.0 to 1.0.
* */
void plotHSV(int x, int y, double hue, double saturation, double value);
void plotHSV(int x, int y, int hue, int saturation, int value);
/* Read
* With this function we find out what colour the pixel (x, y) is. If "colour" is 1,
* it will return the red coefficient, if it is set to 2, the green one, and if
* it set to 3, the blue colour coefficient will be returned,
* and this returned value will be of type int and be between 0 and 65535.
* Note that if you call read() on a pixel outside the image range, the value returned
* will be 0.
* */
int read(int x, int y, int colour);
/* Read, Average
* Same as the above, only that the average of the three colour coefficients is returned.
*/
int read(int x, int y);
/* dRead
* With this function we find out what colour the pixel (x, y) is. If "colour" is 1,
* it will return the red coefficient, if it is set to 2, the green one, and if
* it set to 3, the blue colour coefficient will be returned,
* and this returned value will be of type double and be between 0.0 and 1.0.
* Note that if you call dread() outside the image range, the value returned will be 0.0
* */
double dread(int x, int y, int colour);
/* dRead, Average
* Same as the above, only that the average of the three colour coefficients is returned.
*/
double dread(int x, int y);
/* Read HSV
* With this function we find out what colour the pixel (x, y) is, but in the Hue,
* Saturation, Value colourspace. If "colour" is 1,
* it will return the Hue coefficient, if it is set to 2, the Saturation one, and if
* it set to 3, the Value colour coefficient will be returned, and this returned
* value will be of type int and be between 0 and 65535. Important: If you attempt
* to read the Hue of a pixel that is a shade of grey, the value returned will be
* nonsensical or even NaN. This is just the way the RGB -> HSV algorithm works:
* the Hue of grey is not defined. You might want to check whether the pixel
* you are reading is grey before attempting a readHSV().
* Tip: This is especially useful for categorizing sections of the image according
* to their colour.
* */
int readHSV(int x, int y, int colour);
/* dRead HSV
* With this function we find out what colour the pixel (x, y) is, but in the Hue,
* Saturation, Value colourspace. If "colour" is 1,
* it will return the Hue coefficient, if it is set to 2, the Saturation one, and if
* it set to 3, the Value colour coefficient will be returned,
* and this returned value will be of type double and be between 0.0 and 1.0.
* */
double dreadHSV(int x, int y, int colour);
/* Clear
* The whole image is set to black.
* */
void clear(void);
/* Close
* Close the instance of the class, and write the image to disk.
* Tip: If you do not call this function before your program ends, no image
* will be written to disk.
* */
void close(void);
/* Rename
* To rename the file once an instance of pngwriter has been created.
* Useful for assigning names to files based upon their content.
* Tip: This is as easy as calling pngwriter_rename("newname.png")
* If the argument is a long unsigned int, for example 77, the filename will be changed to
* 0000000077.png
* Tip: Use this to create sequences of images for movie generation.
* */
void pngwriter_rename(char * newname);
void pngwriter_rename(const char * newname);
void pngwriter_rename(long unsigned int index);
/* Figures
* These functions draw basic shapes. Available in both int and double versions.
* The line functions use the fast Bresenham algorithm. Despite the name,
* the square functions draw rectangles. The circle functions use a fast
* integer math algorithm. The filled circle functions make use of sqrt().
* */
void line(int xfrom, int yfrom, int xto, int yto, int red, int green,int blue);
void line(int xfrom, int yfrom, int xto, int yto, double red, double green,double blue);
void triangle(int x1, int y1, int x2, int y2, int x3, int y3, int red, int green, int blue);
void triangle(int x1, int y1, int x2, int y2, int x3, int y3, double red, double green, double blue);
void square(int xfrom, int yfrom, int xto, int yto, int red, int green,int blue);
void square(int xfrom, int yfrom, int xto, int yto, double red, double green,double blue);
void filledsquare(int xfrom, int yfrom, int xto, int yto, int red, int green,int blue);
void filledsquare(int xfrom, int yfrom, int xto, int yto, double red, double green,double blue);
void circle(int xcentre, int ycentre, int radius, int red, int green, int blue);
void circle(int xcentre, int ycentre, int radius, double red, double green, double blue);
void filledcircle(int xcentre, int ycentre, int radius, int red, int green, int blue);
void filledcircle(int xcentre, int ycentre, int radius, double red, double green, double blue);
/* Read From File
* Open the existing PNG image, and copy it into this instance of the class. Now you can access
* that image's pixels with read(x, y, colour), you can change the image, or whatever you want.
* It can be called like this, also: readfromfile("image.png"). It is important to mention that
* not all colour types and bit depths are supported. Try and make sure that your PNG image is
* of bit depth 8 or 16.
* */
void readfromfile(char * name);
void readfromfile(const char * name);
/* Get Height
* When you open a PNG with readfromfile() you can find out its height with this function.
* */
int getheight(void);
/* Get Width
* When you open a PNG with readfromfile() you can find out its width with this function.
* */
int getwidth(void);
/* Set Compression Level
* Set the compression level that will be used for the image. -1 is to use the default,
* 0 is none, 9 is best compression.
* Remember that this will affect how long it will take to close() the image. A value of 2 or 3
* is good enough for regular use, but for storage or transmission you might want to take the time
* to set it at 9.
* */
void setcompressionlevel(int level);
/* Get Bit Depth
* When you open a PNG with readfromfile() you can find out its bit depth with this function.
* Mostly for troubleshooting uses.
* */
int getbitdepth(void);
/* Get Colour Type
* When you open a PNG with readfromfile() you can find out its colour type (libpng categorizes
* different styles of image data with this number).
* Mostly for troubleshooting uses.
* */
int getcolortype(void);
/* Set Gamma Coeff
* Set the image's gamma (file gamma) coefficient. This is experimental, but use it if your image's colours seem too bright
* or too dark. The default value of 0.5 should be fine. The standard disclaimer about Mac and PC gamma
* settings applies.
* */
void setgamma(double gamma);
/* Get Gamma Coeff
* Get the image's gamma coefficient. This is experimental.
* */
double getgamma(void);
/* Bezier Curve
* (After Frenchman Pierre B?zier from Regie Renault)
* A collection of formulae for describing curved lines
* and surfaces, first used in 1972 to model automobile surfaces.
* (from the The Free On-line Dictionary of Computing)
* See http://www.moshplant.com/direct-or/bezier/ for one of many
* available descriptions of bezier curves.
* There are four points used to define the curve: the two endpoints
* of the curve are called the anchor points, while the other points,
* which define the actual curvature, are called handles or control points.
* Moving the handles lets you modify the shape of the curve.
* */
void bezier( int startPtX, int startPtY,
int startControlX, int startControlY,
int endPtX, int endPtY,
int endControlX, int endControlY,
double red, double green, double blue);
void bezier( int startPtX, int startPtY,
int startControlX, int startControlY,
int endPtX, int endPtY,
int endControlX, int endControlY,
int red, int green, int blue);
/* Set Text
* Sets the text information in the PNG header. If it is not called, the default is used.
*/
void settext(char * title, char * author, char * description, char * software);
void settext(const char * title, const char * author, const char * description, const char * software);
/* Version Number
* Returns the PNGwriter version number.
*/
static double version(void);
/* Write PNG
* Writes the PNG image to disk. You can still change the PNGwriter instance after this.
* Tip: This is exactly the same as close(), but easier to remember.
* Tip: To make a sequence of images using only one instance of PNGwriter, alter the image, change its name,
* write_png(), then alter the image, change its name, write_png(), etc.
*/
void write_png(void);
/* Plot Text
* Uses the Freetype2 library to set text in the image. face_path is the file path to a
* TrueType font file (.ttf) (FreeType2 can also handle other types). fontsize specifices the approximate
* height of the rendered font in pixels. x_start and y_start specify the placement of the
* lower, left corner of the text string. angle is the text angle in radians. text is the text to be rendered.
* The colour coordinates can be doubles from 0.0 to 1.0 or ints from 0 to 65535.
* Tip: PNGwriter installs a few fonts in /usr/local/share/pngwriter/fonts to get you started.
* Tip: Remember to add -DNO_FREETYPE to your compilation flags if PNGwriter was compiled without FreeType support.
* */
void plot_text(char * face_path, int fontsize, int x_start, int y_start, double angle, char * text, double red, double green, double blue);
void plot_text(char * face_path, int fontsize, int x_start, int y_start, double angle, char * text, int red, int green, int blue);
/* Plot UTF-8 Text
* Same as the above, but the text to be plotted is encoded in UTF-8. Why would you want this? To be able to plot
* all characters available in a large TrueType font, for example: for rendering Japenese, Chinese and other
* languages not restricted to the standard 128 character ASCII space.
* Tip: The quickest way to get a string into UTF-8 is to write it in an adequate text editor, and save it as a file
* in UTF-8 encoding, which can then be read in in binary mode.
* */
void plot_text_utf8(char * face_path, int fontsize, int x_start, int y_start, double angle, char * text, double red, double green, double blue);
void plot_text_utf8(char * face_path, int fontsize, int x_start, int y_start, double angle, char * text, int red, int green, int blue);
/* Bilinear Interpolation of Image
* Given a floating point coordinate (x from 0.0 to width, y from 0.0 to height),
* this function will return the interpolated colour intensity specified by
* colour (where red = 1, green = 2, blue = 3).
* bilinear_interpolate_read() returns an int from 0 to 65535, and
* bilinear_interpolate_dread() returns a double from 0.0 to 1.0.
* Tip: Especially useful for enlarging an image.
* */
int bilinear_interpolation_read(double x, double y, int colour);
double bilinear_interpolation_dread(double x, double y, int colour);
/* Plot Blend
* Plots the colour given by red, green blue, but blended with the existing pixel
* value at that position. opacity is a double that goes from 0.0 to 1.0.
* 0.0 will not change the pixel at all, and 1.0 will plot the given colour.
* Anything in between will be a blend of both pixel levels.
* */
void plot_blend(int x, int y, double opacity, int red, int green, int blue);
void plot_blend(int x, int y, double opacity, double red, double green, double blue);
/* Invert
* Inverts the image in RGB colourspace.
* */
void invert(void);
/* Resize Image
* Resizes the PNGwriter instance. Note: All image data is set to black (this is
* a resizing, not a scaling, of the image).
* */
void resize(int width, int height);
/* Boundary Fill
* All pixels adjacent to the start pixel will be filled with the fill colour, until the boundary colour is encountered.
* For example, calling boundary_fill() with the boundary colour set to red, on a pixel somewhere inside a red circle,
* will fill the entire circle with the desired fill colour. If, on the other hand, the circle is not the boundary colour,
* the rest of the image will be filled.
* The colour components are either doubles from 0.0 to 1.0 or ints from 0 to 65535.
* */
void boundary_fill(int xstart, int ystart, double boundary_red,double boundary_green,double boundary_blue,double fill_red, double fill_green, double fill_blue) ;
void boundary_fill(int xstart, int ystart, int boundary_red,int boundary_green,int boundary_blue,int fill_red, int fill_green, int fill_blue) ;
/* Flood Fill
* All pixels adjacent to the start pixel will be filled with the fill colour, if they are the same colour as the
* start pixel. For example, calling flood_fill() somewhere in the interior of a solid blue rectangle will colour
* the entire rectangle the fill colour. The colour components are either doubles from 0.0 to 1.0 or ints from 0 to 65535.
* */
void flood_fill(int xstart, int ystart, double fill_red, double fill_green, double fill_blue) ;
void flood_fill(int xstart, int ystart, int fill_red, int fill_green, int fill_blue) ;
/* Polygon
* This function takes an array of integer values containing the coordinates of the vertexes of a polygon.
* Note that if you want a closed polygon, you must repeat the first point's coordinates for the last point.
* It also requires the number of points contained in the array. For example, if you wish to plot a triangle,
* the array will contain 6 elements, and the number of points is 3. Be very careful about this; if you specify the wrong number
* of points, your program will either segfault or produce points at nonsensical coordinates.
* The colour components are either doubles from 0.0 to 1.0 or ints from 0 to 65535.
* */
void polygon(int * points, int number_of_points, double red, double green, double blue);
void polygon(int * points, int number_of_points, int red, int green, int blue);
/* Plot CMYK
* Plot a point in the Cyan, Magenta, Yellow, Black colourspace. Please note that this colourspace is
* lossy, i.e. it cannot reproduce all colours on screen that RGB can. The difference, however, is
* barely noticeable. The algorithm used is a standard one. The colour components are either
* doubles from 0.0 to 1.0 or ints from 0 to 65535.
* */
void plotCMYK(int x, int y, double cyan, double magenta, double yellow, double black);
void plotCMYK(int x, int y, int cyan, int magenta, int yellow, int black);

/* Read CMYK, Double version
* Get a pixel in the Cyan, Magenta, Yellow, Black colourspace. if 'colour' is 1, the Cyan component will be returned
* as a double from 0.0 to 1.0. If 'colour is 2, the Magenta colour component will be returned, and so on, up to 4.
* */
double dreadCMYK(int x, int y, int colour);
/* Read CMYK
* Same as the above, but the colour components returned are an int from 0 to 65535.
* */
int readCMYK(int x, int y, int colour);
/* Scale Proportional
* Scale the image using bilinear interpolation. If k is greater than 1.0, the image will be enlarged.
* If k is less than 1.0, the image will be shrunk. Negative or null values of k are not allowed.
* The image will be resized and the previous content will be replaced by the scaled image.
* Tip: use getheight() and getwidth() to find out the new width and height of the scaled image.
* Note: After scaling, all images will have a bit depth of 16, even if the original image had
* a bit depth of 8.
* */
void scale_k(double k);
/* Scale Non-Proportional
* Scale the image using bilinear interpolation, with different horizontal and vertical scale factors.
* */
void scale_kxky(double kx, double ky);
/* Scale To Target Width and Height
* Scale the image in such a way as to meet the target width and height.
* Tip: if you want to keep the image proportional, scale_k() might be more appropriate.
* */
void scale_wh(int finalwidth, int finalheight);
/* Blended Functions
* All these functions are identical to their non-blended types. They take an extra argument, opacity, which is
* a double from 0.0 to 1.0 and represents how much of the original pixel value is retained when plotting the
* new pixel. In other words, if opacity is 0.7, then after plotting, the new pixel will be 30% of the
* original colour the pixel was, and 70% of the new colour, whatever that may be. As usual, each function
* is available in int or double versions.
* */
// Start Blended Functions
void plotHSV_blend(int x, int y, double opacity, double hue, double saturation, double value);
void plotHSV_blend(int x, int y, double opacity, int hue, int saturation, int value);
void line_blend(int xfrom, int yfrom, int xto, int yto, double opacity, int red, int green,int blue);
void line_blend(int xfrom, int yfrom, int xto, int yto, double opacity, double red, double green,double blue);
void square_blend(int xfrom, int yfrom, int xto, int yto, double opacity, int red, int green,int blue);
void square_blend(int xfrom, int yfrom, int xto, int yto, double opacity, double red, double green,double blue);
void filledsquare_blend(int xfrom, int yfrom, int xto, int yto, double opacity, int red, int green,int blue);
void filledsquare_blend(int xfrom, int yfrom, int xto, int yto, double opacity, double red, double green,double blue);
void circle_blend(int xcentre, int ycentre, int radius, double opacity, int red, int green, int blue);
void circle_blend(int xcentre, int ycentre, int radius, double opacity, double red, double green, double blue);
void filledcircle_blend(int xcentre, int ycentre, int radius, double opacity, int red, int green, int blue);
void filledcircle_blend(int xcentre, int ycentre, int radius, double opacity, double red, double green, double blue);
void bezier_blend( int startPtX, int startPtY,
int startControlX, int startControlY,
int endPtX, int endPtY,
int endControlX, int endControlY,
double opacity,
double red, double green, double blue);
void bezier_blend( int startPtX, int startPtY,
int startControlX, int startControlY,
int endPtX, int endPtY,
int endControlX, int endControlY,
double opacity,
int red, int green, int blue);
void plot_text_blend(char * face_path, int fontsize, int x_start, int y_start, double angle, char * text, double opacity, double red, double green, double blue);
void plot_text_blend(char * face_path, int fontsize, int x_start, int y_start, double angle, char * text, double opacity, int red, int green, int blue);
void plot_text_utf8_blend(char * face_path, int fontsize, int x_start, int y_start, double angle, char * text, double opacity, double red, double green, double blue);
void plot_text_utf8_blend(char * face_path, int fontsize, int x_start, int y_start, double angle, char * text, double opacity, int red, int green, int blue);
void boundary_fill_blend(int xstart, int ystart, double opacity, double boundary_red,double boundary_green,double boundary_blue,double fill_red, double fill_green, double fill_blue) ;
void boundary_fill_blend(int xstart, int ystart, double opacity, int boundary_red,int boundary_green,int boundary_blue,int fill_red, int fill_green, int fill_blue) ;
void flood_fill_blend(int xstart, int ystart, double opacity, double fill_red, double fill_green, double fill_blue) ;
void flood_fill_blend(int xstart, int ystart, double opacity, int fill_red, int fill_green, int fill_blue) ;
void polygon_blend(int * points, int number_of_points, double opacity, double red, double green, double blue);
void polygon_blend(int * points, int number_of_points, double opacity, int red, int green, int blue);
void plotCMYK_blend(int x, int y, double opacity, double cyan, double magenta, double yellow, double black);
void plotCMYK_blend(int x, int y, double opacity, int cyan, int magenta, int yellow, int black);
// End of Blended Functions
/* Laplacian
* This function applies a discrete laplacian to the image, multiplied by a constant factor.
* The kernel used in this case is:
* 1.0 1.0 1.0
* 1.0 -8.0 1.0
* 1.0 1.0 1.0
* Basically, this works as an edge detector. The current pixel is assigned the sum of all neighbouring
* pixels, multiplied by the corresponding kernel element. For example, imagine a pixel and its 8 neighbours:
* 1.0 1.0 0.0 0.0
* 1.0 ->1.0<- 0.0 0.0
* 1.0 1.0 0.0 0.0
* This represents a border between white and black, black is on the right. Applying the laplacian to
* the pixel specified above pixel gives:
* 1.0*1.0 + 1.0*1.0 + 0.0*1.0 +
* 1.0*1.0 + 1.0*-8.0 + 0.0*1.0 +
* 1.0*1.0 + 1.0*1.0 + 0.0*1.0 = -3.0
* Applying this to the pixel to the right of the pixel considered previously, we get a sum of 3.0.
* That is, after passing over an edge, we get a high value for the pixel adjacent to the edge. Since
* PNGwriter limits the colour components if they are off-scale, and the result of the laplacian
* may be negative, a scale factor and an offset value are included. This might be useful for
* keeping things within range or for bringing out more detail in the edge detection. The
* final pixel value will be given by:
* final value = laplacian(original pixel)*k + offset
* Tip: Try a value of 1.0 for k to start with, and then experiment with other values.
* */
void laplacian(double k, double offset);
/* Filled Triangle
* Draws the triangle specified by the three pairs of points in the colour specified
* by the colour coefficients. The colour components are either doubles from 0.0 to
* 1.0 or ints from 0 to 65535.
* */
void filledtriangle(int x1,int y1,int x2,int y2,int x3,int y3, int red, int green, int blue);
void filledtriangle(int x1,int y1,int x2,int y2,int x3,int y3, double red, double green, double blue);
/* Filled Triangle, Blended
* Draws the triangle specified by the three pairs of points in the colour specified
* by the colour coefficients, and blended with the background. See the description for Blended Functions.
* The colour components are either doubles from 0.0 to 1.0 or ints from 0 to 65535.
* */
void filledtriangle_blend(int x1,int y1,int x2,int y2,int x3,int y3, double opacity, int red, int green, int blue);
void filledtriangle_blend(int x1,int y1,int x2,int y2,int x3,int y3, double opacity, double red, double green, double blue);
/* Arrow, Filled Arrow
* Plots an arrow from (x1, y1) to (x2, y2) with the arrowhead at the second point, given the size in pixels
* and the angle in radians of the arrowhead. The plotted arrow consists of one main line, and two smaller
* lines originating from the second point. Filled Arrow plots the same, but the arrowhead is a solid triangle.
* Tip: An angle of 10 to 30 degrees looks OK.
* */
void arrow( int x1,int y1,int x2,int y2,int size, double head_angle, double red, double green, double blue);
void arrow( int x1,int y1,int x2,int y2,int size, double head_angle, int red, int green, int blue);
void filledarrow( int x1,int y1,int x2,int y2,int size, double head_angle, double red, double green, double blue);
void filledarrow( int x1,int y1,int x2,int y2,int size, double head_angle, int red, int green, int blue);
/* Cross, Maltese Cross
* Plots a simple cross at x, y, with the specified height and width, and in the specified colour.
* Maltese cross plots a cross, as before, but adds bars at the end of each arm of the cross.
* The size of these bars is specified with x_bar_height and y_bar_width.
* The cross will look something like this:
*
* ----- <-- ( y_bar_width)
* |
* |
* |-------| <-- ( x_bar_height )
* |
* |
* -----
* */
void cross( int x, int y, int xwidth, int yheight, double red, double green, double blue);
void cross( int x, int y, int xwidth, int yheight, int red, int green, int blue);
void maltesecross( int x, int y, int xwidth, int yheight, int x_bar_height, int y_bar_width, double red, double green, double blue);
void maltesecross( int x, int y, int xwidth, int yheight, int x_bar_height, int y_bar_width, int red, int green, int blue);
/* Diamond and filled diamond
* Plots a diamond shape, given the x, y position, the width and height, and the colour.
* Filled diamond plots a filled diamond.
* */
void filleddiamond( int x, int y, int width, int height, int red, int green, int blue);
void diamond(int x, int y, int width, int height, int red, int green, int blue);
void filleddiamond( int x, int y, int width, int height, double red, double green, double blue);
void diamond(int x, int y, int width, int height, double red, double green, double blue);
/* Get Text Width, Get Text Width UTF8
* Returns the approximate width, in pixels, of the specified *unrotated* text. It is calculated by adding
* each letter's width and kerning value (as specified in the TTF file). Note that this will not
* give the position of the farthest pixel, but it will give a pretty good idea of what area the
* text will occupy. Tip: The text, when plotted unrotated, will fit approximately in a box with its lower left corner at
* (x_start, y_start) and upper right at (x_start + width, y_start + size), where width is given by get_text_width()
* and size is the specified size of the text to be plotted. Tip: Text plotted at position
* (x_start, y_start), rotated with a given 'angle', and of a given 'size'
* whose width is 'width', will fit approximately inside a rectangle whose corners are at
* 1 (x_start, y_start)
* 2 (x_start + width*cos(angle), y_start + width*sin(angle))
* 3 (x_start + width*cos(angle) - size*sin(angle), y_start + width*sin(angle) + size*cos(angle))
* 4 (x_start - size*sin(angle), y_start + size*cos(angle))
* */
int get_text_width(char * face_path, int fontsize, char * text);
int get_text_width_utf8(char * face_path, int fontsize, char * text);
};
#endif
#include "pngwriter.h"
#include <math.h>
#include <iostream.h>
#include <string>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <stdlib.h>
#include <stdio.h>
#include "Mandel.h"
using namespace std;
int main(int argc, char *argv[]) {
char *mandel_version = "Version 1.0";
char *power_string = NULL;
if (argc == 2) {
power_string = argv[1];
}
//이미지 크기
int width = 300;
int height = 300;
/*
원 영상 x and y 의 범위
float x_min = -2.5;
float x_max = 2.5;
float y_min = -1.5;
float y_max = 1.5;
원 영상에서 확대하기 위한 범위
float x_min = -2.5/(2^n) //여기서 n : 1~5정도 범위를 넣음;
float x_max = 2.5; //고정
float y_min = -1.5; // x_min과 같은 비율
float y_max = 1.5; //고정
*/
float x_min = -2.5;
float x_max = 2.5;
float y_min = -1.5;
float y_max = 1.5;
// x값 y값은 픽셀 위치를 저장
// x_slope, y_slope는 x,y값의 변환값
float x_value = 0;
float y_value = 0;
float x_slope = ((float)(x_max - x_min))/((float)width);
float y_slope = ((float)(y_max - y_min))/((float)height);
int color_value = 65535; // 16 bit 색
float ratio = 0;
float power = 2.02;
// create a mandelbrot set calculation object
Mandel M;
M.set_max_iterations(100); //반복횟수 지정 : 100회
if (power_string) {
power = atof(power_string);
}
M.set_power(power);
pngwriter image(width,height,0,"mandel.png");
int progress_points = 20;
int progress_mod = width/progress_points;
for (int x=0; x<=width; x++) {
if (!(x % progress_mod)) { printf("%3.0f%n",100.0 * float(x)/float(width)); }
for (int y=0; y<=height; y++) {
x_value = ((float)x)*x_slope+x_min;
y_value = ((float)y)*y_slope+y_min;
// set the point to be tested
M.set_xy(x_value,y_value);
M.calculate();
ratio = M.get_ratio();
if (ratio == 0) {//수렴
// point is within the set
image.plot(x,y,color_value,color_value,color_value);
} else { //발산
image.plotHSV(x,y,(double)0.656-(0.656* ratio),(double)(0.7)*(1.0 - ratio),1.0);
}
}
}
image.setgamma(0.7);
image.close();
return 0;
}
------------------------------------------------------------
[복소 좌표를 관리하는 프로그램 Header]
#ifndef COMPLX_H
#define COMPLX_H

#include <math.h>
#include <stdlib.h>
class Complx {
protected:
float a; //real part
float b; //imaginary part
double p; //power
char *complx_version;
public:
Complx(float, float);
void set_power(double);
void raise_to_power();
void Set(Complx);
void Add(Complx);
void Print();
float get_real();
float get_imaginary();
char *version() {return complx_version; };
};
#endif
---------------------------------------------------------------
[복소좌표에 관련하여 수행하는 프로그램]
#include <stdio.h>
#include "Complx.h"
Complx::Complx(float a, float b ) {
this->a = a;
this->b = b;
complx_version = "Complx: Version 1.0";
}
void Complx::set_power(double p) {
this->p = p;
}
void Complx::raise_to_power() {
double theta = atan2(b,a);
double r = sqrt(a*a + b*b);
a = (float) (pow(r,p) * cos(p*theta));
b = (float) (pow(r,p) * sin(p*theta));
}
void Complx::Set(Complx z) {
a = z.get_real();
b = z.get_imaginary();
}
void Complx::Add(Complx z) {
a = a + z.get_real();
b = b + z.get_imaginary();
}
float Complx::get_real() {
return a;
}
float Complx::get_imaginary() {
return b;
}
void Complx::Print() {
printf("%f + %f in",(float)a,(float)b);
}
---------------------------------------------------------------
[만델브로트, 줄리아 관련하여 수행하는 프로그램]
#include <math.h>
#include <stdio.h>
#include "Mandel.h"
#include "Complx.h"
void Mandel::set_power(float p ) {
this->p = p;
}
void Mandel::set_max_iterations(int r ) {
max_iterations = r;
}
float Mandel::get_ratio() {
if (converge) {
return 0;
} else {
return ratio;
}
}
void Mandel::set_xy(float x, float y) {
this->x = x;
this->y = y;
}
void Mandel::calculate() {
/************************
z1 = z0^2 + z0
z2 = z1^2 + z0
z3 = z2^2 + z0
z4 = z3^2 + z0
**************************/
Complx z(x,y);
z.set_power(p);
Complx c(x,y);
converge = 1;
iteration_count = 0;
do {
z.raise_to_power(); // z0^2
z.Add(c); // z0^2+z0;
converge= (abs((int)z.get_real()) < 2) && (abs((int)z.get_imaginary())<2) ;
++iteration_count; // 반복회수 계산
} while (converge && (iteration_count<=max_iterations));
ratio = ((float)iteration_count)/((float)(max_iterations+1));
}
char *Mandel::version() {
Complx z(1.0,1.0);
strcpy(version_string,mandel_version);
strcat(version_string,", ");
strcat(version_string,z.version());
return version_string;
};
한편, 만델브로트 방정식과 줄리아 방정식의 이론식을 살펴보면 다음과 같다.
만델브로트 집합은 복소 평면에서의 점들의 모임이다. 만델브로트 집합은 아래 식(1)을 만족시킨다.
(1)
z=z*z+c
여기서, 점 C는 이 복소 평면상에서 무한대로 발산하지 않는 점들의 모임이다.
줄리아 집합은 고정된 C 값에 대하여 만델브로트 방정식에서 발생된 점들의 모임이다.
만델브로트 집합 연산식을 해석해보도록 한다.
z=z*z+c(z=x+iy, c=a+ib)
z의 초기값을 z=0+0i로 하여 점화식을 반복하여 계산한다.
그 결과는 c값에 의존한다. 즉 c값에 따라 z가 하나의 값으로 수렴하기도 하고 여러 값 사이를 순환적으로 맴돌기도 하고 아주 큰 값으로 발산하기도 한다. 만델브로트 집합은 초기값을 z=0+0i로 했을때 z=z*z+c을 발산시키지 않는 복소수 c들의 모임이다.
파이겐바움 분기도 x=ax(1-x)에서 x의 초기값을 0.2로 하고 점화식을 반복할 때, x는 a의 값에 따라 수렴하기도 하고, 여러 값 사이를 순환적으로 움직이기도 하고 카오스적인 값이 반복되기도 한다.
만델브로트 집합에서 마찬가지로 z=0+0i로 점화식을 계속 반복하여 계산하고 c값에 따라 z가 하나의 값으로 수렴하기도 하고 여러 값 사이를 순환적으로 맴돌기도 하고 큰 값으로 발산하기도 한다. 만델브로트 집합은 z의 초기값을 z=0+0i 으로 하였을 때, z=z*z+c를 발산시키지 않는 복소수 c들의 모임이다.
집합의 발산, 수렴, 순환을 살펴본다.
z*z+c=(x+iy)*(x+iy)+a+ib
= (x*x-y*y+i2xy)+a+ib
= (x*x-y*y+a)+i(2xy+b)이므로
x+iy=(x*x-y*y+a)+i(2xy+b) 따라서
x=x*x-y*y+a, y=2xy+b
임의의 (a,b)를 만델브로트 공식에 대입한다.
-2에서 2의 범위 하에서 c값을 임의로 한점 정한다.
줄리아 집합 연산식을 해석해보도록 한다.
1) Xn+1 = Xn^2 - Yn^2 + a --> a 값 고정시킨다.
2) Yn+1 = 2 XnYn + b --> b값 고정시킨다.
3) 만델브로트와는 달리 C값을 고정하고, 주어진 Z의 값을 시스템에 반복적용하여 출력값이 수렴하는가 발산하는가를 판단하여 줄리아 집합에 속하는지를 결정한다.
4)현실적으로 무한히 반복하는 것은 불가능하므로 특정 반복횟수 동안 원점에서의 거리가 2를 넘느냐, 안 넘느냐로 판단한다.
이를 위한 프로그램을 살펴본다.
만델브로트 프로그램:
1.pixel의 값의 범위를 -2.5에서 2.5까지로 해서 각 pixel 각 각에서 z(0)의 값을 pixel의 값으로 주고 z(n)의 크기가 일정크기 이상이 되거나 또는 일정한 반복횟수에 이를 때까지의 iteration 수를 헤아려 iteration 수가 작으면 작을수록 발산한다고 보고 그 수에 해당하는 색깔을 주어서 나타낸다.
for(y = 0; y <= LCD_HEIGHT; y++)
{
for(x = 0; x <= LCD_WIDTH; x++)
{
cx = xMin+x*delta;
cy = yMax-y*delta;
zx= 0.;
zy = 0.;
for(i = 0; i < recursiv ; i++)
{
// Calculate the new zx, zy
tx = zx*zx-zy*zy+cx;
ty = 2*zx*zy + cy;
zx = tx;
zy = ty;
// 발산한다면 출력
if((zx*zx+zy*zy)>4)
break;
}
줄리아 프로그램:
1.C 값을 임의의 수로 고정시킨다.
cx = -0.629578;
cy = -0.41524;
2.화면의 X,Y의 값에 따라 모든 Zn 값에 대해 수렴 발산 여부를 결정하여 출력시킨다..
for(y = 0; y <= LCD_HEIGHT; y++)
{
for(x = 0; x <= LCD_WIDTH; x++)
{
zx = xMin+x*delta;
zy = yMax-y*delta;
for(i = 0; i < recursiv ; i++)
{
tx = zx*zx-zy*zy+cx;
ty = 2*zx*zy+cy;
zx = tx;
zy = ty;
if((zx*zx+zy*zy)>4)
break;
}
전술한 내용을 바탕으로 카오스패턴을 예시하도록 한다.
Figure 112015069827585-pat00001
Figure 112015069827585-pat00002
Figure 112015069827585-pat00003
Figure 112015069827585-pat00004
Figure 112015069827585-pat00005
Figure 112015069827585-pat00006
Figure 112015069827585-pat00007
Figure 112015069827585-pat00008
Figure 112015069827585-pat00009
Figure 112015069827585-pat00010
Figure 112015069827585-pat00011
Figure 112015069827585-pat00012
Figure 112015069827585-pat00013
Figure 112015069827585-pat00014
Figure 112015069827585-pat00015
Figure 112015069827585-pat00016
Figure 112015069827585-pat00017
Figure 112015069827585-pat00018
Figure 112015069827585-pat00019
Figure 112015069827585-pat00020
Figure 112015069827585-pat00021
Figure 112015069827585-pat00022
Figure 112015069827585-pat00023
Figure 112015069827585-pat00024
Figure 112015069827585-pat00025
Figure 112015069827585-pat00026
Figure 112015069827585-pat00027
Figure 112015069827585-pat00028
Figure 112015069827585-pat00029
Figure 112015069827585-pat00030
Figure 112015069827585-pat00031
Figure 112015069827585-pat00032
Figure 112015069827585-pat00033
Figure 112015069827585-pat00034
Figure 112015069827585-pat00035
Figure 112015069827585-pat00036
Figure 112015069827585-pat00037
Figure 112015069827585-pat00038
Figure 112015069827585-pat00039
Figure 112015069827585-pat00040
Figure 112015069827585-pat00041
Figure 112015069827585-pat00042
Figure 112015069827585-pat00043
Figure 112015069827585-pat00044
Figure 112015069827585-pat00045
Figure 112015069827585-pat00046
Figure 112015069827585-pat00047
Figure 112015069827585-pat00048
Figure 112015069827585-pat00049
Figure 112015069827585-pat00050
Figure 112015069827585-pat00051
Figure 112015069827585-pat00052
Figure 112015069827585-pat00053
Figure 112015069827585-pat00054
Figure 112015069827585-pat00055
Figure 112015069827585-pat00056
Figure 112015069827585-pat00057
Figure 112015069827585-pat00058
Figure 112015069827585-pat00059
Figure 112015069827585-pat00060
Figure 112015069827585-pat00061
Figure 112015069827585-pat00062
Figure 112015069827585-pat00063
Figure 112015069827585-pat00064
Figure 112015069827585-pat00065
Figure 112015069827585-pat00066
Figure 112015069827585-pat00067
Figure 112015069827585-pat00068
Figure 112015069827585-pat00069
Figure 112015069827585-pat00070
Figure 112015069827585-pat00071
Figure 112015069827585-pat00072
Figure 112015069827585-pat00073
Figure 112015069827585-pat00074
Figure 112015069827585-pat00075
Figure 112015069827585-pat00076
Figure 112015069827585-pat00077
Figure 112015069827585-pat00078
Figure 112015069827585-pat00079
Figure 112015069827585-pat00080
Figure 112015069827585-pat00081
Figure 112015069827585-pat00082
Figure 112015069827585-pat00083
Figure 112015069827585-pat00084
Figure 112015069827585-pat00085
Figure 112015069827585-pat00086
Figure 112015069827585-pat00087
Figure 112015069827585-pat00088
Figure 112015069827585-pat00089
Figure 112015069827585-pat00090
Figure 112015069827585-pat00091
Figure 112015069827585-pat00092
Figure 112015069827585-pat00093
Figure 112015069827585-pat00094
Figure 112015069827585-pat00095
Figure 112015069827585-pat00096
Figure 112015069827585-pat00097
Figure 112015069827585-pat00098
Figure 112015069827585-pat00099
Figure 112015069827585-pat00100
Figure 112015069827585-pat00101
Figure 112015069827585-pat00102
Figure 112015069827585-pat00103
Figure 112015069827585-pat00104
Figure 112015069827585-pat00105
Figure 112015069827585-pat00106
Figure 112015069827585-pat00107
Figure 112015069827585-pat00108
Figure 112015069827585-pat00109
Figure 112015069827585-pat00110
Figure 112015069827585-pat00111
Figure 112015069827585-pat00112
Figure 112015069827585-pat00113
Figure 112015069827585-pat00114
Figure 112015069827585-pat00115
Figure 112015069827585-pat00116
Figure 112015069827585-pat00117
Figure 112015069827585-pat00118
Figure 112015069827585-pat00119
Figure 112015069827585-pat00120
Figure 112015069827585-pat00121
Figure 112015069827585-pat00122
Figure 112015069827585-pat00123
Figure 112015069827585-pat00124
Figure 112015069827585-pat00125
Figure 112015069827585-pat00126
Figure 112015069827585-pat00127
Figure 112015069827585-pat00128
Figure 112015069827585-pat00129
Figure 112015069827585-pat00130
Figure 112015069827585-pat00131
Figure 112015069827585-pat00132
Figure 112015069827585-pat00133
Figure 112015069827585-pat00134
Figure 112015069827585-pat00135
Figure 112015069827585-pat00136
Figure 112015069827585-pat00137
Figure 112015069827585-pat00138
Figure 112015069827585-pat00139
Figure 112015069827585-pat00140
Figure 112015069827585-pat00141
Figure 112015069827585-pat00142
Figure 112015069827585-pat00143
Figure 112015069827585-pat00144
Figure 112015069827585-pat00145
Figure 112015069827585-pat00146
Figure 112015069827585-pat00147
Figure 112015069827585-pat00148
Figure 112015069827585-pat00149
Figure 112015069827585-pat00150
Figure 112015069827585-pat00151
Figure 112015069827585-pat00152
Figure 112015069827585-pat00153
Figure 112015069827585-pat00154
Figure 112015069827585-pat00155
Figure 112015069827585-pat00156
Figure 112015069827585-pat00157
Figure 112015069827585-pat00158
Figure 112015069827585-pat00159
Figure 112015069827585-pat00160
Figure 112015069827585-pat00161
Figure 112015069827585-pat00162
Figure 112015069827585-pat00163
Figure 112015069827585-pat00164
Figure 112015069827585-pat00165
Figure 112015069827585-pat00166
Figure 112015069827585-pat00167
Figure 112015069827585-pat00168
Figure 112015069827585-pat00169
Figure 112015069827585-pat00170
Figure 112015069827585-pat00171
Figure 112015069827585-pat00172
Figure 112015069827585-pat00173
Figure 112015069827585-pat00174
Figure 112015069827585-pat00175
Figure 112015069827585-pat00176
Figure 112015069827585-pat00177
Figure 112015069827585-pat00178
Figure 112015069827585-pat00179
Figure 112015069827585-pat00180
Figure 112015069827585-pat00181
Figure 112015069827585-pat00182
Figure 112015069827585-pat00183
Figure 112015069827585-pat00184
Figure 112015069827585-pat00185
Figure 112015069827585-pat00186
Figure 112015069827585-pat00187
Figure 112015069827585-pat00188
Figure 112015069827585-pat00189
Figure 112015069827585-pat00190
Figure 112015069827585-pat00191
Figure 112015069827585-pat00192
Figure 112015069827585-pat00193
Figure 112015069827585-pat00194
Figure 112015069827585-pat00195
Figure 112015069827585-pat00196
Figure 112015069827585-pat00197
Figure 112015069827585-pat00198
Figure 112015069827585-pat00199
Figure 112015069827585-pat00200
Figure 112015069827585-pat00201
Figure 112015069827585-pat00202
Figure 112015069827585-pat00203
Figure 112015069827585-pat00204
Figure 112015069827585-pat00205
Figure 112015069827585-pat00206
Figure 112015069827585-pat00207
Figure 112015069827585-pat00208
Figure 112015069827585-pat00209
Figure 112015069827585-pat00210
Figure 112015069827585-pat00211
Figure 112015069827585-pat00212
Figure 112015069827585-pat00213
Figure 112015069827585-pat00214
Figure 112015069827585-pat00215
Figure 112015069827585-pat00216
Figure 112015069827585-pat00217
Figure 112015069827585-pat00218
Figure 112015069827585-pat00219
Figure 112015069827585-pat00220
Figure 112015069827585-pat00221
Figure 112015069827585-pat00222
Figure 112015069827585-pat00223
Figure 112015069827585-pat00224
Figure 112015069827585-pat00225
Figure 112015069827585-pat00226
Figure 112015069827585-pat00227
Figure 112015069827585-pat00228
Figure 112015069827585-pat00229
Figure 112015069827585-pat00230
Figure 112015069827585-pat00231
Figure 112015069827585-pat00232
Figure 112015069827585-pat00233
Figure 112015069827585-pat00234
Figure 112015069827585-pat00235
Figure 112015069827585-pat00236
Figure 112015069827585-pat00237
Figure 112015069827585-pat00238
Figure 112015069827585-pat00239
Figure 112015069827585-pat00240
Figure 112015069827585-pat00241
Figure 112015069827585-pat00242
Figure 112015069827585-pat00243
Figure 112015069827585-pat00244
Figure 112015069827585-pat00245
Figure 112015069827585-pat00246
Figure 112015069827585-pat00247
Figure 112015069827585-pat00248
Figure 112015069827585-pat00249
Figure 112015069827585-pat00250
Figure 112015069827585-pat00251
Figure 112015069827585-pat00252
Figure 112015069827585-pat00253
Figure 112015069827585-pat00254
Figure 112015069827585-pat00255
Figure 112015069827585-pat00256
Figure 112015069827585-pat00257
Figure 112015069827585-pat00258
Figure 112015069827585-pat00259
Figure 112015069827585-pat00260
Figure 112015069827585-pat00261
Figure 112015069827585-pat00262
Figure 112015069827585-pat00263
Figure 112015069827585-pat00264
Figure 112015069827585-pat00265
Figure 112015069827585-pat00266
Figure 112015069827585-pat00267
Figure 112015069827585-pat00268
Figure 112015069827585-pat00269
Figure 112015069827585-pat00270
Figure 112015069827585-pat00271
Figure 112015069827585-pat00272
Figure 112015069827585-pat00273
Figure 112015069827585-pat00274
Figure 112015069827585-pat00275
Figure 112015069827585-pat00276
Figure 112015069827585-pat00277
Figure 112015069827585-pat00278
Figure 112015069827585-pat00279
Figure 112015069827585-pat00280
Figure 112015069827585-pat00281
Figure 112015069827585-pat00282
Figure 112015069827585-pat00283
Figure 112015069827585-pat00284
Figure 112015069827585-pat00285

Figure 112015069827585-pat00286
Figure 112015069827585-pat00287
Figure 112015069827585-pat00288
Figure 112015069827585-pat00289
Figure 112015069827585-pat00290
Figure 112015069827585-pat00291
Figure 112015069827585-pat00292
Figure 112015069827585-pat00293
Figure 112015069827585-pat00294
Figure 112015069827585-pat00295
Figure 112015069827585-pat00296
Figure 112015069827585-pat00297
Figure 112015069827585-pat00298
Figure 112015069827585-pat00299
Figure 112015069827585-pat00300
Figure 112015069827585-pat00301
Figure 112015069827585-pat00302
Figure 112015069827585-pat00303
Figure 112015069827585-pat00304
Figure 112015069827585-pat00305
Figure 112015069827585-pat00306
Figure 112015069827585-pat00307
Figure 112015069827585-pat00308
Figure 112015069827585-pat00309
Figure 112015069827585-pat00310
Figure 112015069827585-pat00311
Figure 112015069827585-pat00312
Figure 112015069827585-pat00313
Figure 112015069827585-pat00314
Figure 112015069827585-pat00315
Figure 112015069827585-pat00316
Figure 112015069827585-pat00317
Figure 112015069827585-pat00318
Figure 112015069827585-pat00319
Figure 112015069827585-pat00320
Figure 112015069827585-pat00321
Figure 112015069827585-pat00322
Figure 112015069827585-pat00323
Figure 112015069827585-pat00324
Figure 112015069827585-pat00325
Figure 112015069827585-pat00326
Figure 112015069827585-pat00327
Figure 112015069827585-pat00328
Figure 112015069827585-pat00329
Figure 112015069827585-pat00330
Figure 112015069827585-pat00331
Figure 112015069827585-pat00332
Figure 112015069827585-pat00333
Figure 112015069827585-pat00334
Figure 112015069827585-pat00335
Figure 112015069827585-pat00336
Figure 112015069827585-pat00337
Figure 112015069827585-pat00338
Figure 112015069827585-pat00339
Figure 112015069827585-pat00340
Figure 112015069827585-pat00341
Figure 112015069827585-pat00342
Figure 112015069827585-pat00343
Figure 112015069827585-pat00344
Figure 112015069827585-pat00345
Figure 112015069827585-pat00346
Figure 112015069827585-pat00347
Figure 112015069827585-pat00348
Figure 112015069827585-pat00349
Figure 112015069827585-pat00350
Figure 112015069827585-pat00351
Figure 112015069827585-pat00352
Figure 112015069827585-pat00353
Figure 112015069827585-pat00354
Figure 112015069827585-pat00355
Figure 112015069827585-pat00356
Figure 112015069827585-pat00357

Claims (1)

  1. 의류, 가방, 신발과 같은 패션제품의 무늬로 이용하기 위해서 만델브로트 연산식, 줄리아 연산식을 계산하는 컴퓨터 프로그램에 의해서 생성하는 카오스패턴 생성방법에 있어서,
    만델브로트 프로그램은 pixel의 값의 범위를 -2.5에서 2.5까지로 해서 각 pixel 각각에서 z(0)의 값을 pixel의 값으로 주고 z(n)의 크기가 일정크기 이상이 되거나 또는 일정한 반복횟수에 이를 때까지의 iteration 수를 헤아려 iteration 수가 작으면 작을수록 발산하고 그 수에 해당하는 색깔을 주어서 나타내고;
    줄리아 프로그램은 C 값을 임의의 수로 고정시키고,
    cx = -0.629578,
    cy = -0.41524,
    화면의 X, Y의 값에 따라 모든 Zn 값에 대해 수렴 발산 여부를 결정하여 출력시킨 것을 특징으로 하는 카오스패턴 생성방법.



KR1020150102200A 2015-07-20 2015-07-20 카오스패턴생성방법 KR102091501B1 (ko)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020150102200A KR102091501B1 (ko) 2015-07-20 2015-07-20 카오스패턴생성방법

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020150102200A KR102091501B1 (ko) 2015-07-20 2015-07-20 카오스패턴생성방법

Publications (2)

Publication Number Publication Date
KR20170010495A KR20170010495A (ko) 2017-02-01
KR102091501B1 true KR102091501B1 (ko) 2020-03-20

Family

ID=58109388

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020150102200A KR102091501B1 (ko) 2015-07-20 2015-07-20 카오스패턴생성방법

Country Status (1)

Country Link
KR (1) KR102091501B1 (ko)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101206290B1 (ko) 2012-06-27 2012-11-29 주식회사 넥스파시스템 직물패턴 알고리즘 적용을 통한 품질검사 장치 및 그 제어방법

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2509860B2 (ja) * 1993-03-08 1996-06-26 株式会社エイ・ティ・アール視聴覚機構研究所 パタ―ン生成装置
JPH11123289A (ja) * 1997-10-22 1999-05-11 Brother Ind Ltd 刺繍データ処理装置及び刺繍ミシン並びに記録媒体

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101206290B1 (ko) 2012-06-27 2012-11-29 주식회사 넥스파시스템 직물패턴 알고리즘 적용을 통한 품질검사 장치 및 그 제어방법

Also Published As

Publication number Publication date
KR20170010495A (ko) 2017-02-01

Similar Documents

Publication Publication Date Title
Ebert et al. Texturing and modeling: a procedural approach
KR100891428B1 (ko) 컬러 그라디언트 생성을 위한 시스템 및 방법, 컬러 그라디언트를 용이하게 하는 보간 방법, 컬러 그라디언트를 용이하게 하는 데이터 패킷을 저장하는 컴퓨터 판독가능 기록 매체
EP2043048B1 (en) Method for rendering a region of a composite glyph
US6573889B1 (en) Analytic warping
Theoharis et al. Graphics and visualization: principles & algorithms
CN105096385B (zh) 一种二维地震剖面三维显示方法
Eck Introduction to Computer Graphics
US7034845B2 (en) Method for antialiasing an object represented as a two-dimensional distance field in image-order
US20130063472A1 (en) Customized image filters
US20040189642A1 (en) Methods for generating an adaptively sampled distance field of an object with specialized cells
US7034830B2 (en) Method for generating a two-dimensional distance field within a cell associated with a corner of a two-dimensional object
Tian et al. A survey of smooth vector graphics: Recent advances in representation, creation, rasterization and image vectorization
US7030881B2 (en) Method for converting two-dimensional objects to distance fields
US20150062115A1 (en) Contour gradients using three-dimensional models
KR102091501B1 (ko) 카오스패턴생성방법
US7123271B2 (en) Method and apparatus for antialiasing a set of objects represented as a set of two-dimensional distance fields in image-order
US20180005432A1 (en) Shading Using Multiple Texture Maps
Stemkoski et al. Developing Graphics Frameworks with Java and OpenGL
Popov et al. Visualization of Multidimensional Hypersurface Extrema by Lumigraph
US6750862B1 (en) Method and system for performing enhanced lighting functions for texture map data
EP2063395A2 (en) Tinting a surface to simulate a visual effect in a computer generated scene
Rudolph A Framework for example-based Synthesis of Materials for Physically Based Rendering
Arroyo et al. Stochastic generation of dots for computer aided stippling
Chung et al. Pixel-Based Manipulations
Anderson Interactive Computer Graphics

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant