@jjlmoya/utils-science 1.31.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/category/index.ts +2 -1
- package/src/entries.ts +3 -1
- package/src/index.ts +1 -0
- package/src/tests/locale_completeness.test.ts +2 -2
- package/src/tests/tool_validation.test.ts +2 -2
- package/src/tool/mandelbrot-fractal/bibliography.astro +14 -0
- package/src/tool/mandelbrot-fractal/bibliography.ts +16 -0
- package/src/tool/mandelbrot-fractal/component.astro +242 -0
- package/src/tool/mandelbrot-fractal/entry.ts +26 -0
- package/src/tool/mandelbrot-fractal/i18n/de.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/en.ts +160 -0
- package/src/tool/mandelbrot-fractal/i18n/es.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/fr.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/id.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/it.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/ja.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/ko.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/nl.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/pl.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/pt.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/ru.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/sv.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/tr.ts +159 -0
- package/src/tool/mandelbrot-fractal/i18n/zh.ts +159 -0
- package/src/tool/mandelbrot-fractal/index.ts +11 -0
- package/src/tool/mandelbrot-fractal/logic/MandelbrotEngine.ts +67 -0
- package/src/tool/mandelbrot-fractal/mandelbrot-fractal-calculator.css +357 -0
- package/src/tool/mandelbrot-fractal/seo.astro +15 -0
- package/src/tools.ts +2 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
2
|
+
import type { ToolLocaleContent } from '../../../types';
|
|
3
|
+
|
|
4
|
+
const slug = 'mandelbrot-fraktal-hesaplayici';
|
|
5
|
+
const title = 'Mandelbrot Fraktal Hesaplayici & Self Similarity Explorer';
|
|
6
|
+
const description = 'Mandelbrot kumesini kesfedin, kendine benzeyen fraktal sinirlara yakinsayin ve yineleme derinligi, renk kontrasti ve karmasik duzlem koordinatlarini karsilastirin.';
|
|
7
|
+
|
|
8
|
+
const howTo = [
|
|
9
|
+
{
|
|
10
|
+
name: 'Mandelbrot kumesinin bir bolgesini secin',
|
|
11
|
+
text: 'Tam kumeden baslayin veya denizati vadisi ya da spiral minibrot gibi yuksek detayli bir bolgeye dogrudan atlayin.',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'Gorsele tiklayarak yakinsayin',
|
|
15
|
+
text: 'Canvas uzerindeki herhangi bir noktaya tiklayarak karmasik duzlemi yeniden merkezleyin ve fraktali o koordinat etrafinda buyutun.',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'Yineleme derinligini ve renk kontrastini ayarlayin',
|
|
19
|
+
text: 'Daha ince sinir yapisini ortaya cikarmak icin yineleme butcesini artirin, ardindan kacis suresi bantlarini daha okunabilir hale getirmek icin kontrast ve paleti ayarlayin.',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const faq = [
|
|
24
|
+
{
|
|
25
|
+
question: 'Mandelbrot kumesi hesaplayicisi ne gosterir?',
|
|
26
|
+
answer: 'z = 0 dan baslandiginda z(n+1) = z(n)^2 + c yinelemesini sinirli tutan karmasik sayilari c gosterir. Secilen yineleme butcesi icinde asla kacmayan noktalar kumenin uyeleri olarak renklendirilirken, dis noktalar yorungelerinin ne kadar hizli kactigina gore renklendirilir.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
question: 'Mandelbrot kume siniri neden bu kadar cok detay iceriyor?',
|
|
30
|
+
answer: 'Sinir, kararli ve kacan yorungeleri ayirir ve bu sinir yakinindaki kucuk koordinat degisiklikleri uzun vadeli davranisi tamamen degistirebilir. Bu hassasiyet, ice ice gecmis ampuller, spiraller, filamentler ve bircok buyutme seviyesinde ortaya cikan minyatur kopyalar olusturur.',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
question: 'Mandelbrot kumesi gercekten kendine benzer mi?',
|
|
34
|
+
answer: 'Bir Sierpinski ucgeni ile ayni katı anlamda mukemmel sekilde kendine benzemez, ancak zengin bir yari-kendine benzerlige sahiptir. Tum kumenin kucuk kopyalari duzlem boyunca, genellikle bozulmus ve ayrintili dallanma yapilariyla birbirine baglanmis olarak gorunur.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
question: 'Yineleme sayisi neyi kontrol eder?',
|
|
38
|
+
answer: 'Yineleme sayisi, hesaplayicinin her noktayi muhtemelen kumeye ait olduguna karar vermeden once ne kadar sure test edecegini kontrol eder. Daha yuksek degerler daha derin filamentleri ve daha temiz minibrotlari ortaya cikarir, ancak piksel basina daha fazla hesaplama gerektirir.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
question: 'Siyah bolgenin disinda renkler neden degisiyor?',
|
|
42
|
+
answer: 'Dis renkler kacis suresine dayanir: hizli kacan noktaler, bircok yineleme boyunca kumeye yakin kalan noktalardan farkli renkler alir. Yumusak renklendirme sert bantlari azaltir ve yakin yorungelerin geometrisini incelemeyi kolaylastirir.',
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
export const content: ToolLocaleContent = {
|
|
47
|
+
slug,
|
|
48
|
+
title,
|
|
49
|
+
description,
|
|
50
|
+
ui: {
|
|
51
|
+
title: 'Mandelbrot Fraktal Hesaplayici',
|
|
52
|
+
canvasLabel: 'Etkilesimli Mandelbrot kumesi canvas',
|
|
53
|
+
presetsLabel: 'Mandelbrot bolgesi on ayarlari',
|
|
54
|
+
presetFull: 'Tam Kume',
|
|
55
|
+
presetSeahorse: 'Denizati Vadisi',
|
|
56
|
+
presetSpiral: 'Spiral Minibrot',
|
|
57
|
+
centerPoint: 'Merkez',
|
|
58
|
+
magnification: 'Buyutme',
|
|
59
|
+
visibleWindow: 'Gorunur pencere',
|
|
60
|
+
renderBudget: 'Yineleme',
|
|
61
|
+
iterationsLabel: 'Yineleme derinligi',
|
|
62
|
+
contrastLabel: 'Kacis kontrasti',
|
|
63
|
+
colorLabel: 'Renk alani',
|
|
64
|
+
paletteEmber: 'Kor bantlari',
|
|
65
|
+
paletteLagoon: 'Lagun plazmasi',
|
|
66
|
+
paletteInk: 'Murekkep spektrumu',
|
|
67
|
+
},
|
|
68
|
+
seo: [
|
|
69
|
+
{
|
|
70
|
+
type: 'title',
|
|
71
|
+
text: 'Mandelbrot Set Calculator for Fractals, Escape Time, and Self-Similarity',
|
|
72
|
+
level: 2,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: 'paragraph',
|
|
76
|
+
html: 'Bu Mandelbrot fraktal hesaplayicisi, <strong>z(n+1) = z(n)^2 + c</strong> yinelemesiyle tanimlanan klasik karmasik duzlem kumesini render eder. Pasif izlemeden ziyade kesif icin tasarlanmistir: her tiklayis duzlemi yeniden merkezler, her yakinsama daha kucuk bir matematiksel komsulugu ortaya cikarir ve yineleme kaydiricisi, hesaplayicinin bir noktayi kararli veya kacan olarak renklendirmeden once siniri ne kadar derin test etmesi gerektigine karar vermenizi saglar.',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'title',
|
|
80
|
+
text: 'How to Read the Mandelbrot Image',
|
|
81
|
+
level: 3,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: 'paragraph',
|
|
85
|
+
html: 'Koyu merkezi sekil, yorungeleri mevcut yineleme butcesi icinde sinirli kalan noktalari isaretler. Renkli dis kisim bir kacis suresi haritasidir. Kumeye yakin renklendirilmis bir nokta, buyuklugu kacis yaricapini asmadan once yuzlerce yineleme hayatta kalabilirken, uzaktaki bir nokta neredeyse aninda kacar. Bilimsel olarak en ilginc geometri genellikle dolu seklin icinde degil, sinirli ve sinirsiz davranisin ic ice gectigi sinir boyuncadir.',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: 'table',
|
|
89
|
+
headers: ['Kontrol', 'Neyi degistirir', 'Ne zaman artirilmali'],
|
|
90
|
+
rows: [
|
|
91
|
+
['<strong>Yineleme derinligi</strong>', 'Her piksel icin kac yineleme adiminin test edildigi.', 'Ince filamentlere veya minyatur kopyalara yakinsadiktan sonra daha yuksek degerler kullanin.'],
|
|
92
|
+
['<strong>Kacis kontrasti</strong>', 'Yumusak kacis degerlerinin gorunur bantlara ne kadar guclu ayrildigi.', 'Goruntu duz gorundugunde yukseltin; renkler cok sert oldugunda dusurun.'],
|
|
93
|
+
['<strong>Palet</strong>', 'Dis noktalara uygulanan renk eslemesi.', 'Bir renk alani tarafindan gizlenebilecek yapilari ortaya cikarmak icin paletleri degistirin.'],
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: 'title',
|
|
98
|
+
text: 'Self-Similarity and Minibrots',
|
|
99
|
+
level: 3,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: 'paragraph',
|
|
103
|
+
html: 'Mandelbrot kumesinin bu kadar unlu olmasinin bir nedeni yari-kendine benzerligidir. Antenlere, spirallere ve vadilere yakinsadikca, minibrotlar olarak adlandirilan kucuk Mandelbrot benzeri adalarla tekrar tekrar karsilasirsiniz. Bu kopyalar sadece dekoratif degildir. Dizilisleri, periyodik ampuller, bifurcation patternleri ve yorungelerin kacmadan once uzun sureler boyunca kapali kaldigi bolgeler dahil olmak uzere, karesel haritalarin dinamigini yansitir.',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: 'title',
|
|
107
|
+
text: 'Why Higher Iterations Matter at Deep Zoom',
|
|
108
|
+
level: 3,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: 'paragraph',
|
|
112
|
+
html: 'Tam kume goruntusunde, makul bir yineleme siniri taninabilir bir goruntu verir. Ancak daha derin buyutmede, bircok sinir noktasi kacip kacmadiklarini ortaya cikarmak icin cok daha uzun surer. Yineleme siniri cok dusukse, ince yapilar yanlislikla kat veya bulanik gorunebilir. Yineleme sayisini yukseltmek sinir siniflandirmasini iyilestirir ve hesaplayicinin dar dallari, spiral kollari ve uydu ampulleri daha fazla guvenle cozmesini saglar.',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: 'title',
|
|
116
|
+
text: 'Mathematical Meaning of the Complex Coordinates',
|
|
117
|
+
level: 3,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: 'paragraph',
|
|
121
|
+
html: 'Koordinat okumasi, goruntuleme alaninin mevcut merkezini karmasik bir sayi olarak c = a + bi gosterir. Yatay eksen gercek kisim, dikey eksen ise sanal kisimdir. Canvas uzerine tiklamak yeni bir karmasik koordinat secer ve ardindan gorunur pencereyi onun etrafinda buyutur. Bu, araci fraktalin gorsel bolgelerinin karmasik duzlemdeki kesin konumlara nasil karsilik geldigini ogrenmek icin kullanisli hale getirir.',
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
faq,
|
|
125
|
+
bibliography,
|
|
126
|
+
howTo,
|
|
127
|
+
schemas: [
|
|
128
|
+
{
|
|
129
|
+
'@context': 'https://schema.org',
|
|
130
|
+
'@type': 'SoftwareApplication',
|
|
131
|
+
name: title,
|
|
132
|
+
description,
|
|
133
|
+
applicationCategory: 'ScientificApplication',
|
|
134
|
+
operatingSystem: 'Any',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
'@context': 'https://schema.org',
|
|
138
|
+
'@type': 'FAQPage',
|
|
139
|
+
mainEntity: faq.map((item) => ({
|
|
140
|
+
'@type': 'Question',
|
|
141
|
+
name: item.question,
|
|
142
|
+
acceptedAnswer: {
|
|
143
|
+
'@type': 'Answer',
|
|
144
|
+
text: item.answer,
|
|
145
|
+
},
|
|
146
|
+
})),
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
'@context': 'https://schema.org',
|
|
150
|
+
'@type': 'HowTo',
|
|
151
|
+
name: title,
|
|
152
|
+
step: howTo.map((step) => ({
|
|
153
|
+
'@type': 'HowToStep',
|
|
154
|
+
name: step.name,
|
|
155
|
+
text: step.text,
|
|
156
|
+
})),
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
2
|
+
import type { ToolLocaleContent } from '../../../types';
|
|
3
|
+
|
|
4
|
+
const slug = 'mandelbrot-fractal-calculator';
|
|
5
|
+
const title = 'Mandelbrot Fractal Calculator & Self Similarity Explorer';
|
|
6
|
+
const description = '探索Mandelbrot集合,放大观察自相似的分形边界,并比较迭代深度、颜色对比度和复平面坐标。';
|
|
7
|
+
|
|
8
|
+
const howTo = [
|
|
9
|
+
{
|
|
10
|
+
name: '选择Mandelbrot集合的一个区域',
|
|
11
|
+
text: '从完整集合开始,或直接跳转到高细节区域,例如海马谷或螺旋形迷你brots。',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: '点击图像进行缩放',
|
|
15
|
+
text: '点击画布上的任意点,以重新居中复平面并放大该坐标周围的分形。',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: '调整迭代深度和颜色对比度',
|
|
19
|
+
text: '增加迭代预算以揭示更精细的边界结构,然后调整对比度和调色板,使逃逸时间带更易于阅读。',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const faq = [
|
|
24
|
+
{
|
|
25
|
+
question: 'Mandelbrot集合计算器显示什么?',
|
|
26
|
+
answer: '它显示哪些复数 c 在从 z = 0 开始时能使递推关系 z(n+1) = z(n)^2 + c 保持有界。在所选的迭代预算内从未逃逸的点被着色为集合的成员,而外部点则根据其轨道逃逸的速度进行着色。',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
question: '为什么Mandelbrot集合的边界包含如此多的细节?',
|
|
30
|
+
answer: '边界分隔了稳定轨道和逃逸轨道,边界附近微小的坐标变化可能完全改变长期行为。这种敏感性产生了嵌套的 bulbs、螺旋、细丝以及在多个放大级别出现的微型副本。',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
question: 'Mandelbrot集合真的是自相似的吗?',
|
|
34
|
+
answer: '它在与谢尔宾斯三角形相同的严格意义上并非完全自相似,但它具有丰富的准自相似性。整个集合的小副本出现在整个平面上,通常被扭曲并通过精细的分支结构连接在一起。',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
question: '迭代次数控制什么?',
|
|
38
|
+
answer: '迭代次数控制计算器在判定每个点可能属于集合之前对其进行测试的时间。更高的值会揭示更深的细丝和更清晰的迷你brots,但需要每像素更多的计算。',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
question: '为什么黑色区域之外的颜色会变化?',
|
|
42
|
+
answer: '外部的颜色基于逃逸时间:快速逃逸的点与多次迭代后仍停留在集合附近的点获得不同的颜色。平滑着色减少了生硬的条带,使附近轨道的几何形状更易于检查。',
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
export const content: ToolLocaleContent = {
|
|
47
|
+
slug,
|
|
48
|
+
title,
|
|
49
|
+
description,
|
|
50
|
+
ui: {
|
|
51
|
+
title: 'Mandelbrot Fractal Calculator',
|
|
52
|
+
canvasLabel: '交互式Mandelbrot集合画布',
|
|
53
|
+
presetsLabel: 'Mandelbrot区域预设',
|
|
54
|
+
presetFull: '完整集合',
|
|
55
|
+
presetSeahorse: '海马谷',
|
|
56
|
+
presetSpiral: '螺旋形迷你brot',
|
|
57
|
+
centerPoint: '中心',
|
|
58
|
+
magnification: '放大倍数',
|
|
59
|
+
visibleWindow: '可见窗口',
|
|
60
|
+
renderBudget: '迭代次数',
|
|
61
|
+
iterationsLabel: '迭代深度',
|
|
62
|
+
contrastLabel: '逃逸对比度',
|
|
63
|
+
colorLabel: '颜色场',
|
|
64
|
+
paletteEmber: '余烬带',
|
|
65
|
+
paletteLagoon: '泻湖等离子体',
|
|
66
|
+
paletteInk: '墨水光谱',
|
|
67
|
+
},
|
|
68
|
+
seo: [
|
|
69
|
+
{
|
|
70
|
+
type: 'title',
|
|
71
|
+
text: 'Mandelbrot Set Calculator for Fractals, Escape Time, and Self-Similarity',
|
|
72
|
+
level: 2,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: 'paragraph',
|
|
76
|
+
html: '此Mandelbrot分形计算器渲染由迭代 <strong>z(n+1) = z(n)^2 + c</strong> 定义的经典复平面集合。它专为探索而非被动观看而设计:每次点击都会重新居中平面,每次缩放都会暴露一个更小的数学邻域,而迭代滑块可让您决定计算器在将点着色为稳定或逃逸之前应对边界进行多深的测试。',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'title',
|
|
80
|
+
text: 'How to Read the Mandelbrot Image',
|
|
81
|
+
level: 3,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: 'paragraph',
|
|
85
|
+
html: '深色中心形状标记了在当前迭代预算内轨道保持有界的点。彩色外部是逃逸时间图。靠近集合着色的点可能在其幅度超过逃逸半径之前经受数百次迭代,而较远的点几乎立即逃逸。最具科学趣味的几何形状通常不在填充形状内部,而是在有界与无界行为交织的边界沿线。',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: 'table',
|
|
89
|
+
headers: ['控制', '更改内容', '何时增加'],
|
|
90
|
+
rows: [
|
|
91
|
+
['<strong>迭代深度</strong>', '每个像素测试的递推步骤数。', '在放大到细小细丝或微型副本后使用更高的值。'],
|
|
92
|
+
['<strong>逃逸对比度</strong>', '平滑逃逸值被分离成可见带的强度。', '当图像看起来平坦时提高;当颜色过于刺眼时降低。'],
|
|
93
|
+
['<strong>调色板</strong>', '应用于外部点的颜色映射。', '切换调色板以揭示可能被单一颜色场隐藏的结构。'],
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: 'title',
|
|
98
|
+
text: 'Self-Similarity and Minibrots',
|
|
99
|
+
level: 3,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: 'paragraph',
|
|
103
|
+
html: 'Mandelbrot集合如此著名的一个原因是其准自相似性。当您放大天线、螺旋和山谷时,您会反复遇到类似Mandelbrot的小岛,通常称为迷你brots。这些副本不仅仅是装饰性的。它们的排列反映了二次映射的动力学,包括周期性bulbs、分岔模式以及轨道在逃逸前长时间被困的区域。',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: 'title',
|
|
107
|
+
text: 'Why Higher Iterations Matter at Deep Zoom',
|
|
108
|
+
level: 3,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: 'paragraph',
|
|
112
|
+
html: '在完整集合视图下,适度的迭代限制可生成可识别的图像。然而,在更深放大倍数下,许多边界点需要更长的时间才能揭示它们是否逃逸。如果迭代限制太低,精细结构可能会错误地看起来是实心或模糊的。提高迭代次数可改善边界分类,并使计算器能够更自信地解析狭窄的卷须、旋臂和卫星bulbs。',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: 'title',
|
|
116
|
+
text: 'Mathematical Meaning of the Complex Coordinates',
|
|
117
|
+
level: 3,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: 'paragraph',
|
|
121
|
+
html: '坐标读数将视口的当前中心显示为复数 c = a + bi。水平轴是实部,垂直轴是虚部。点击画布会选择一个新的复数坐标,然后放大其周围的可见窗口。这使得该工具对于学习分形的视觉区域如何对应于复平面中的精确位置非常有用。',
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
faq,
|
|
125
|
+
bibliography,
|
|
126
|
+
howTo,
|
|
127
|
+
schemas: [
|
|
128
|
+
{
|
|
129
|
+
'@context': 'https://schema.org',
|
|
130
|
+
'@type': 'SoftwareApplication',
|
|
131
|
+
name: title,
|
|
132
|
+
description,
|
|
133
|
+
applicationCategory: 'ScientificApplication',
|
|
134
|
+
operatingSystem: 'Any',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
'@context': 'https://schema.org',
|
|
138
|
+
'@type': 'FAQPage',
|
|
139
|
+
mainEntity: faq.map((item) => ({
|
|
140
|
+
'@type': 'Question',
|
|
141
|
+
name: item.question,
|
|
142
|
+
acceptedAnswer: {
|
|
143
|
+
'@type': 'Answer',
|
|
144
|
+
text: item.answer,
|
|
145
|
+
},
|
|
146
|
+
})),
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
'@context': 'https://schema.org',
|
|
150
|
+
'@type': 'HowTo',
|
|
151
|
+
name: title,
|
|
152
|
+
step: howTo.map((step) => ({
|
|
153
|
+
'@type': 'HowToStep',
|
|
154
|
+
name: step.name,
|
|
155
|
+
text: step.text,
|
|
156
|
+
})),
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { mandelbrotFractal } from './entry';
|
|
2
|
+
import type { ToolDefinition } from '../../types';
|
|
3
|
+
|
|
4
|
+
export * from './entry';
|
|
5
|
+
|
|
6
|
+
export const MANDELBROT_FRACTAL_TOOL: ToolDefinition = {
|
|
7
|
+
entry: mandelbrotFractal,
|
|
8
|
+
Component: () => import('./component.astro'),
|
|
9
|
+
SEOComponent: () => import('./seo.astro'),
|
|
10
|
+
BibliographyComponent: () => import('./bibliography.astro'),
|
|
11
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface MandelbrotViewport {
|
|
2
|
+
centerX: number;
|
|
3
|
+
centerY: number;
|
|
4
|
+
scale: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface MandelbrotSample {
|
|
10
|
+
escaped: boolean;
|
|
11
|
+
iterations: number;
|
|
12
|
+
smooth: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface MandelbrotStats {
|
|
16
|
+
magnification: number;
|
|
17
|
+
visibleWidth: number;
|
|
18
|
+
visibleHeight: number;
|
|
19
|
+
centerLabel: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class MandelbrotEngine {
|
|
23
|
+
public sample(real: number, imaginary: number, maxIterations: number): MandelbrotSample {
|
|
24
|
+
let zr = 0;
|
|
25
|
+
let zi = 0;
|
|
26
|
+
let iterations = 0;
|
|
27
|
+
|
|
28
|
+
while (zr * zr + zi * zi <= 4 && iterations < maxIterations) {
|
|
29
|
+
const nextR = zr * zr - zi * zi + real;
|
|
30
|
+
zi = 2 * zr * zi + imaginary;
|
|
31
|
+
zr = nextR;
|
|
32
|
+
iterations += 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (iterations === maxIterations) {
|
|
36
|
+
return { escaped: false, iterations, smooth: iterations };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const magnitude = Math.sqrt(zr * zr + zi * zi);
|
|
40
|
+
const smooth = iterations + 1 - Math.log(Math.log(Math.max(magnitude, 2))) / Math.log(2);
|
|
41
|
+
return { escaped: true, iterations, smooth };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public pixelToComplex(x: number, y: number, viewport: MandelbrotViewport): { real: number; imaginary: number } {
|
|
45
|
+
const aspect = viewport.height / viewport.width;
|
|
46
|
+
const visibleWidth = 3.5 / viewport.scale;
|
|
47
|
+
const visibleHeight = visibleWidth * aspect;
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
real: viewport.centerX + (x / viewport.width - 0.5) * visibleWidth,
|
|
51
|
+
imaginary: viewport.centerY + (y / viewport.height - 0.5) * visibleHeight,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public getStats(viewport: MandelbrotViewport): MandelbrotStats {
|
|
56
|
+
const aspect = viewport.height / viewport.width;
|
|
57
|
+
const visibleWidth = 3.5 / viewport.scale;
|
|
58
|
+
const visibleHeight = visibleWidth * aspect;
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
magnification: viewport.scale,
|
|
62
|
+
visibleWidth,
|
|
63
|
+
visibleHeight,
|
|
64
|
+
centerLabel: `${viewport.centerX.toFixed(6)} ${viewport.centerY >= 0 ? '+' : '-'} ${Math.abs(viewport.centerY).toFixed(6)}i`,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|