@jjlmoya/utils-diy 1.13.0 → 1.15.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/entries.ts +3 -1
- package/src/index.ts +2 -0
- package/src/tests/locale_completeness.test.ts +2 -2
- package/src/tests/tool_validation.test.ts +2 -2
- package/src/tool/pythagoreanRightAngleCalculator/bibliography.astro +6 -0
- package/src/tool/pythagoreanRightAngleCalculator/bibliography.ts +12 -0
- package/src/tool/pythagoreanRightAngleCalculator/component.astro +243 -0
- package/src/tool/pythagoreanRightAngleCalculator/entry.ts +24 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/de.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/en.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/es.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/fr.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/id.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/it.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/ja.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/ko.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/nl.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/pl.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/pt.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/ru.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/sv.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/tr.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/i18n/zh.ts +129 -0
- package/src/tool/pythagoreanRightAngleCalculator/index.ts +11 -0
- package/src/tool/pythagoreanRightAngleCalculator/logic.ts +102 -0
- package/src/tool/pythagoreanRightAngleCalculator/pythagorean-right-angle-calculator.css +387 -0
- package/src/tool/pythagoreanRightAngleCalculator/seo.astro +15 -0
- package/src/tool/pythagoreanRightAngleCalculator/ui.ts +71 -0
- package/src/tools.ts +2 -1
package/package.json
CHANGED
package/src/entries.ts
CHANGED
|
@@ -15,6 +15,7 @@ export { stairCalculator } from './tool/stairCalculator/entry';
|
|
|
15
15
|
export { thermalExpansionCalculator } from './tool/thermalExpansionCalculator/entry';
|
|
16
16
|
export { voltageDropCalculator } from './tool/voltageDropCalculator/entry';
|
|
17
17
|
export { workshopFractionConverter } from './tool/workshopFractionConverter/entry';
|
|
18
|
+
export { pythagoreanRightAngleCalculator } from './tool/pythagoreanRightAngleCalculator/entry';
|
|
18
19
|
export { diyCategory } from './category';
|
|
19
20
|
import { balusterCalculator } from './tool/balusterCalculator/entry';
|
|
20
21
|
import { clayCalculator } from './tool/clayCalculator/entry';
|
|
@@ -30,4 +31,5 @@ import { stairCalculator } from './tool/stairCalculator/entry';
|
|
|
30
31
|
import { thermalExpansionCalculator } from './tool/thermalExpansionCalculator/entry';
|
|
31
32
|
import { voltageDropCalculator } from './tool/voltageDropCalculator/entry';
|
|
32
33
|
import { workshopFractionConverter } from './tool/workshopFractionConverter/entry';
|
|
33
|
-
|
|
34
|
+
import { pythagoreanRightAngleCalculator } from './tool/pythagoreanRightAngleCalculator/entry';
|
|
35
|
+
export const ALL_ENTRIES = [balusterCalculator, clayCalculator, concreteCalculator, cutOptimizer, drillCalculator, drillSharpener, epoxyCalculator, furnitureFit, mortarCalculator, passepartoutCalculator, stairCalculator, thermalExpansionCalculator, voltageDropCalculator, workshopFractionConverter, pythagoreanRightAngleCalculator];
|
package/src/index.ts
CHANGED
|
@@ -44,3 +44,5 @@ export { STAIR_CALCULATOR_TOOL } from './tool/stairCalculator/index';
|
|
|
44
44
|
export { DRILL_SHARPENER_TOOL } from './tool/drillSharpener/index';
|
|
45
45
|
|
|
46
46
|
export { WORKSHOP_FRACTION_CONVERTER_TOOL } from './tool/workshopFractionConverter/index';
|
|
47
|
+
|
|
48
|
+
export { PYTHAGOREAN_RIGHT_ANGLE_CALCULATOR_TOOL } from './tool/pythagoreanRightAngleCalculator/index';
|
|
@@ -4,8 +4,8 @@ import { diyCategory } from '../data';
|
|
|
4
4
|
|
|
5
5
|
describe('Tool Validation Suite', () => {
|
|
6
6
|
describe('Library Registration', () => {
|
|
7
|
-
it('should have
|
|
8
|
-
expect(ALL_TOOLS.length).toBe(
|
|
7
|
+
it('should have 15 tools in ALL_TOOLS', () => {
|
|
8
|
+
expect(ALL_TOOLS.length).toBe(15);
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
it('diyCategory should be defined', () => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BibliographyEntry } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const bibliography: BibliographyEntry[] = [
|
|
4
|
+
{
|
|
5
|
+
name: 'Pythagorean Theorem',
|
|
6
|
+
url: 'https://mathworld.wolfram.com/PythagoreanTheorem.html',
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: '3-4-5 Rule in Construction',
|
|
10
|
+
url: 'https://en.wikipedia.org/wiki/Pythagorean_triple',
|
|
11
|
+
}
|
|
12
|
+
];
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Icon } from 'astro-icon/components';
|
|
3
|
+
import type { PythagoreanRightAngleCalculatorUI } from './ui';
|
|
4
|
+
|
|
5
|
+
interface Props { ui?: PythagoreanRightAngleCalculatorUI; }
|
|
6
|
+
const { ui } = Astro.props;
|
|
7
|
+
const t = (ui ?? {}) as PythagoreanRightAngleCalculatorUI;
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<div class="prac-root" data-prac-root data-ui={JSON.stringify(t)}>
|
|
11
|
+
<div class="prac-container">
|
|
12
|
+
<aside class="prac-inputs">
|
|
13
|
+
<div class="prac-input-group">
|
|
14
|
+
<label>{t.labelUnitSelection || 'Units'}</label>
|
|
15
|
+
<div class="prac-unit-selector">
|
|
16
|
+
<button class="prac-unit-btn active" data-unit="in">{t.btnUnitInches}</button>
|
|
17
|
+
<button class="prac-unit-btn" data-unit="ft">{t.btnUnitFeet}</button>
|
|
18
|
+
<button class="prac-unit-btn" data-unit="cm">{t.btnUnitCentimeters}</button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="prac-input-group">
|
|
23
|
+
<label for="prac-a">{t.labelSideA}</label>
|
|
24
|
+
<input type="number" id="prac-a" inputmode="decimal" placeholder="0" step="0.1">
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div class="prac-input-group">
|
|
28
|
+
<label for="prac-b">{t.labelSideB}</label>
|
|
29
|
+
<input type="number" id="prac-b" inputmode="decimal" placeholder="0" step="0.1">
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="prac-input-group">
|
|
33
|
+
<label for="prac-d">{t.labelMeasuredDiagonal}</label>
|
|
34
|
+
<input type="number" id="prac-d" inputmode="decimal" placeholder="0" step="0.1">
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="prac-button-group">
|
|
38
|
+
<button id="prac-clear" class="prac-btn prac-btn-icon" title={t.btnClear}>
|
|
39
|
+
<Icon name="mdi:delete" />
|
|
40
|
+
</button>
|
|
41
|
+
<button id="prac-copy" class="prac-btn prac-btn-icon" title={t.btnCopyResults}>
|
|
42
|
+
<Icon name="mdi:content-copy" />
|
|
43
|
+
</button>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="prac-presets">
|
|
47
|
+
<button class="prac-preset" data-preset="0">3-4-5</button>
|
|
48
|
+
<button class="prac-preset" data-preset="1">6-8-10</button>
|
|
49
|
+
<button class="prac-preset" data-preset="2">30-40-50</button>
|
|
50
|
+
<button class="prac-preset" data-preset="3">15-20-25</button>
|
|
51
|
+
</div>
|
|
52
|
+
</aside>
|
|
53
|
+
|
|
54
|
+
<main class="prac-display">
|
|
55
|
+
<div id="prac-status" class="prac-status idle">
|
|
56
|
+
<div class="prac-status-indicator"></div>
|
|
57
|
+
<div class="prac-status-content">
|
|
58
|
+
<span class="prac-status-title" id="prac-status-title">Ready</span>
|
|
59
|
+
<span class="prac-status-value" id="prac-status-value">--</span>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div class="prac-results-grid">
|
|
64
|
+
<div class="prac-result-box">
|
|
65
|
+
<span class="prac-result-label">{t.labelIdealDiagonal}</span>
|
|
66
|
+
<span class="prac-result-value" id="prac-ideal">--</span>
|
|
67
|
+
<span id="prac-unit" class="prac-result-unit">in</span>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="prac-result-box">
|
|
70
|
+
<span class="prac-result-label">{t.labelDeviation}</span>
|
|
71
|
+
<span class="prac-result-value" id="prac-dev">--</span>
|
|
72
|
+
<span id="prac-unit-dev" class="prac-result-unit">in</span>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<svg id="prac-svg" viewBox="0 0 280 220" preserveAspectRatio="xMidYMid meet" class="prac-svg">
|
|
77
|
+
<path id="prac-tri" d="" fill="rgba(99, 102, 241, 0.08)" stroke="#6366f1" stroke-width="2"></path>
|
|
78
|
+
<text id="prac-lbl-a" x="0" y="0" class="prac-label">A</text>
|
|
79
|
+
<text id="prac-lbl-b" x="0" y="0" class="prac-label">B</text>
|
|
80
|
+
<text id="prac-lbl-c" x="0" y="0" class="prac-label prac-label-hyp">C</text>
|
|
81
|
+
<path id="prac-corner" d="" fill="none" stroke="#6366f1" stroke-width="1"></path>
|
|
82
|
+
</svg>
|
|
83
|
+
|
|
84
|
+
<div id="prac-message" class="prac-message"></div>
|
|
85
|
+
</main>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<style>
|
|
90
|
+
@import './pythagorean-right-angle-calculator.css';
|
|
91
|
+
</style>
|
|
92
|
+
|
|
93
|
+
<script>
|
|
94
|
+
import { calculateSquaring, PRESET_RULES } from './logic';
|
|
95
|
+
import type { SquaringCalculation } from './logic';
|
|
96
|
+
|
|
97
|
+
const root = document.querySelector('.prac-root') as HTMLElement | null;
|
|
98
|
+
const ui = root ? JSON.parse((root as HTMLElement).dataset.ui || '{}') : {};
|
|
99
|
+
|
|
100
|
+
const inputA = document.getElementById('prac-a') as HTMLInputElement;
|
|
101
|
+
const inputB = document.getElementById('prac-b') as HTMLInputElement;
|
|
102
|
+
const inputD = document.getElementById('prac-d') as HTMLInputElement;
|
|
103
|
+
const unitBtns = document.querySelectorAll('.prac-unit-btn');
|
|
104
|
+
const presetBtns = document.querySelectorAll('.prac-preset');
|
|
105
|
+
const clearBtn = document.getElementById('prac-clear') as HTMLButtonElement;
|
|
106
|
+
const copyBtn = document.getElementById('prac-copy') as HTMLButtonElement;
|
|
107
|
+
|
|
108
|
+
const statusEl = document.getElementById('prac-status') as HTMLElement;
|
|
109
|
+
const statusTitle = document.getElementById('prac-status-title') as HTMLElement;
|
|
110
|
+
const statusValue = document.getElementById('prac-status-value') as HTMLElement;
|
|
111
|
+
const resultIdeal = document.getElementById('prac-ideal') as HTMLElement;
|
|
112
|
+
const resultDev = document.getElementById('prac-dev') as HTMLElement;
|
|
113
|
+
const unitDisplay = document.getElementById('prac-unit') as HTMLElement;
|
|
114
|
+
const unitDevDisplay = document.getElementById('prac-unit-dev') as HTMLElement;
|
|
115
|
+
const msgEl = document.getElementById('prac-message') as HTMLElement;
|
|
116
|
+
|
|
117
|
+
const triPath = document.getElementById('prac-tri')!;
|
|
118
|
+
const lblA = document.getElementById('prac-lbl-a')!;
|
|
119
|
+
const lblB = document.getElementById('prac-lbl-b')!;
|
|
120
|
+
const lblC = document.getElementById('prac-lbl-c')!;
|
|
121
|
+
const corner = document.getElementById('prac-corner')!;
|
|
122
|
+
|
|
123
|
+
let currentUnit = 'in';
|
|
124
|
+
|
|
125
|
+
function setUnit(unit: string) {
|
|
126
|
+
currentUnit = unit;
|
|
127
|
+
unitDisplay.textContent = unit;
|
|
128
|
+
unitDevDisplay.textContent = unit;
|
|
129
|
+
unitBtns.forEach(btn => (btn as HTMLElement).classList.toggle('active', (btn as HTMLElement).getAttribute('data-unit') === unit));
|
|
130
|
+
calculate();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function updateStatus(calc: SquaringCalculation) {
|
|
134
|
+
statusEl.className = `prac-status ${calc.status}`;
|
|
135
|
+
statusTitle.textContent = calc.message || ui.statusReady || 'Ready';
|
|
136
|
+
|
|
137
|
+
if (calc.deviationPercent !== null) {
|
|
138
|
+
statusValue.textContent = `${calc.deviationPercent.toFixed(2)}%`;
|
|
139
|
+
} else {
|
|
140
|
+
statusValue.textContent = '--';
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
msgEl.textContent = calc.correction;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function drawTriangle(a: number, b: number) {
|
|
147
|
+
if (a <= 0 || b <= 0) {
|
|
148
|
+
triPath.setAttribute('d', '');
|
|
149
|
+
lblA.textContent = '';
|
|
150
|
+
lblB.textContent = '';
|
|
151
|
+
lblC.textContent = '';
|
|
152
|
+
corner.setAttribute('d', '');
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const scale = Math.min(180 / Math.max(a, b), 150 / Math.max(a, b));
|
|
157
|
+
const x1 = 20;
|
|
158
|
+
const y1 = 20 + a * scale;
|
|
159
|
+
const x2 = 20 + b * scale;
|
|
160
|
+
const y2 = 20 + a * scale;
|
|
161
|
+
const x3 = 20;
|
|
162
|
+
const y3 = 20;
|
|
163
|
+
|
|
164
|
+
triPath.setAttribute('d', `M ${x1} ${y1} L ${x2} ${y2} L ${x3} ${y3} Z`);
|
|
165
|
+
|
|
166
|
+
lblA.setAttribute('x', `${x1 - 15}`);
|
|
167
|
+
lblA.setAttribute('y', `${(y1 + y3) / 2}`);
|
|
168
|
+
lblA.textContent = `${a.toFixed(1)}`;
|
|
169
|
+
|
|
170
|
+
lblB.setAttribute('x', `${(x1 + x2) / 2}`);
|
|
171
|
+
lblB.setAttribute('y', `${y1 + 18}`);
|
|
172
|
+
lblB.textContent = `${b.toFixed(1)}`;
|
|
173
|
+
|
|
174
|
+
const c = Math.sqrt(a * a + b * b);
|
|
175
|
+
lblC.setAttribute('x', `${(x2 + x3) / 2 + 8}`);
|
|
176
|
+
lblC.setAttribute('y', `${(y2 + y3) / 2 - 8}`);
|
|
177
|
+
lblC.textContent = `${c.toFixed(1)}`;
|
|
178
|
+
|
|
179
|
+
const cornerSize = 10;
|
|
180
|
+
corner.setAttribute('d', `M ${x1 - cornerSize} ${y1 - cornerSize} L ${x1 - cornerSize} ${y1} L ${x1} ${y1}`);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function calculate() {
|
|
184
|
+
const a = parseFloat(inputA.value) || 0;
|
|
185
|
+
const b = parseFloat(inputB.value) || 0;
|
|
186
|
+
const d = parseFloat(inputD.value) || null;
|
|
187
|
+
const calc = calculateSquaring(a, b, d, { unit: currentUnit, ui });
|
|
188
|
+
|
|
189
|
+
if (calc.hypotenuse > 0) {
|
|
190
|
+
resultIdeal.textContent = calc.hypotenuse.toFixed(2);
|
|
191
|
+
resultDev.textContent = calc.deviation !== null ? Math.abs(calc.deviation).toFixed(2) : '--';
|
|
192
|
+
} else {
|
|
193
|
+
resultIdeal.textContent = '--';
|
|
194
|
+
resultDev.textContent = '--';
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
updateStatus(calc);
|
|
198
|
+
drawTriangle(a, b);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function applyPreset(idx: number) {
|
|
202
|
+
const p = PRESET_RULES[idx];
|
|
203
|
+
if (p) {
|
|
204
|
+
inputA.value = p.a.toString();
|
|
205
|
+
inputB.value = p.b.toString();
|
|
206
|
+
inputD.value = '';
|
|
207
|
+
calculate();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
unitBtns.forEach(btn => {
|
|
212
|
+
btn.addEventListener('click', () => setUnit((btn as HTMLElement).getAttribute('data-unit') || 'in'));
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
[inputA, inputB, inputD].forEach(inp => {
|
|
216
|
+
inp.addEventListener('input', calculate);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
presetBtns.forEach((btn, idx) => {
|
|
220
|
+
btn.addEventListener('click', () => applyPreset(idx));
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
clearBtn.addEventListener('click', () => {
|
|
224
|
+
inputA.value = '';
|
|
225
|
+
inputB.value = '';
|
|
226
|
+
inputD.value = '';
|
|
227
|
+
calculate();
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
copyBtn.addEventListener('click', () => {
|
|
231
|
+
let unitText = ui.unitInches;
|
|
232
|
+
if (currentUnit === 'ft') unitText = ui.unitFeet;
|
|
233
|
+
else if (currentUnit === 'cm') unitText = ui.unitCentimeters;
|
|
234
|
+
const text = `${ui.labelIdealDiagonal || 'Ideal'}: ${resultIdeal.textContent}${unitText}, ${ui.labelDeviation || 'Deviation'}: ${resultDev.textContent}${unitText}`;
|
|
235
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
236
|
+
const originalHTML = copyBtn.innerHTML;
|
|
237
|
+
copyBtn.innerHTML = '<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"/></svg>';
|
|
238
|
+
setTimeout(() => (copyBtn.innerHTML = originalHTML), 1500);
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
calculate();
|
|
243
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DiyToolEntry } from '../../types';
|
|
2
|
+
import type { PythagoreanRightAngleCalculatorUI } from './ui';
|
|
3
|
+
|
|
4
|
+
export const pythagoreanRightAngleCalculator: DiyToolEntry<PythagoreanRightAngleCalculatorUI> = {
|
|
5
|
+
id: 'pythagorean-right-angle-calculator-3-4-5-rule',
|
|
6
|
+
icons: { bg: 'mdi:square-outline', fg: 'mdi:ruler-square' },
|
|
7
|
+
i18n: {
|
|
8
|
+
de: () => import('./i18n/de').then((m) => m.content),
|
|
9
|
+
en: () => import('./i18n/en').then((m) => m.content),
|
|
10
|
+
es: () => import('./i18n/es').then((m) => m.content),
|
|
11
|
+
fr: () => import('./i18n/fr').then((m) => m.content),
|
|
12
|
+
id: () => import('./i18n/id').then((m) => m.content),
|
|
13
|
+
it: () => import('./i18n/it').then((m) => m.content),
|
|
14
|
+
ja: () => import('./i18n/ja').then((m) => m.content),
|
|
15
|
+
ko: () => import('./i18n/ko').then((m) => m.content),
|
|
16
|
+
nl: () => import('./i18n/nl').then((m) => m.content),
|
|
17
|
+
pl: () => import('./i18n/pl').then((m) => m.content),
|
|
18
|
+
pt: () => import('./i18n/pt').then((m) => m.content),
|
|
19
|
+
ru: () => import('./i18n/ru').then((m) => m.content),
|
|
20
|
+
sv: () => import('./i18n/sv').then((m) => m.content),
|
|
21
|
+
tr: () => import('./i18n/tr').then((m) => m.content),
|
|
22
|
+
zh: () => import('./i18n/zh').then((m) => m.content),
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { WithContext, FAQPage, SoftwareApplication } from 'schema-dts';
|
|
2
|
+
import type { ToolLocaleContent } from '../../../types';
|
|
3
|
+
import type { PythagoreanRightAngleCalculatorUI } from '../ui';
|
|
4
|
+
import { bibliography } from '../bibliography';
|
|
5
|
+
|
|
6
|
+
const slug = 'satz-des-pythagoras-rechter-winkel-rechner-3-4-5-regel';
|
|
7
|
+
const title = 'Pythagoras Rechter Winkel Rechner: 3 4 5 Regel für perfekte Winkel';
|
|
8
|
+
const description = 'Prüfen Sie mit dem Satz des Pythagoras und der 3-4-5-Regel, ob Strukturen perfekt im 90°-Winkel stehen. Unverzichtbares Tool für Bau, Zimmerei und DIY-Projekte.';
|
|
9
|
+
|
|
10
|
+
const faqData = [
|
|
11
|
+
{
|
|
12
|
+
question: 'Was ist die 3-4-5-Regel?',
|
|
13
|
+
answer: 'Die 3-4-5-Regel ist ein einfaches pythagoreisches Tripel. Wenn ein rechtwinkliges Dreieck Seiten von 3, 4 und 5 Einheiten in beliebigem Maßstab hat, beträgt der Winkel zwischen den kürzeren Seiten genau 90 Grad. Diese praxiserprobte Methode wird seit Jahrhunderten im Bauwesen angewendet.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
question: 'Wie benutze ich diesen Rechner?',
|
|
17
|
+
answer: 'Geben Sie die Längen der beiden Wände (Seiten A und B) ein, die die Ecke bilden. Der Rechner zeigt an, wie groß die Diagonale für einen perfekten 90-Grad-Winkel sein muss. Messen Sie dann Ihre tatsächliche Diagonale und geben Sie diese ein, um zu prüfen, ob Ihre Ecke wirklich rechtwinklig ist.',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
question: 'Was ist, wenn meine Diagonale abweicht?',
|
|
21
|
+
answer: 'Wenn Ihre gemessene Diagonale vom Idealwert abweicht, zeigt der Rechner die Abweichung an. Grün bedeutet perfekt, Gelb akzeptabel, Rot nicht rechtwinklig. Er gibt Ihnen auch an, ob Sie den Winkel öffnen oder schließen müssen.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
question: 'Ist dies genau genug für den Bau?',
|
|
25
|
+
answer: 'Ja. Der Satz des Pythagoras ist mathematisch exakt. Mit einem Maßband können Sie Bau-Präzision ohne Spezialwerkzeug oder Fachkenntnisse erreichen.',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
question: 'Kann ich zwischen Zoll und Fuß wechseln?',
|
|
29
|
+
answer: 'Ja. Wählen Sie Zoll für kleine Projekte oder Fuß für größere Strukturen. Alle Werte werden sofort umgerechnet, ohne dass Daten verloren gehen.',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const howToData = [
|
|
34
|
+
{ name: 'Einheit wählen', text: 'Wählen Sie Zoll für Detailarbeiten oder Fuß für größere Strukturen. Sie können jederzeit wechseln.' },
|
|
35
|
+
{ name: 'Beide Seiten messen', text: 'Messen Sie die Länge der beiden Wände (Seiten A und B), die die zu prüfende Ecke bilden.' },
|
|
36
|
+
{ name: 'Ideale Diagonale prüfen', text: 'Der Rechner zeigt Ihnen, wie groß die Diagonale für einen perfekten 90-Grad-Winkel sein muss.' },
|
|
37
|
+
{ name: 'Diagonale messen', text: 'Messen Sie Ihre tatsächliche Diagonale mit einem Maßband. Geben Sie den Wert im optionalen Feld ein.' },
|
|
38
|
+
{ name: 'Status ablesen', text: 'Grün = perfekt rechtwinklig. Gelb = akzeptabel. Rot = nicht rechtwinklig. Passen Sie wie vorgeschlagen an.' },
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
const faqSchema: WithContext<FAQPage> = {
|
|
42
|
+
'@context': 'https://schema.org',
|
|
43
|
+
'@type': 'FAQPage',
|
|
44
|
+
mainEntity: faqData.map((item) => ({
|
|
45
|
+
'@type': 'Question',
|
|
46
|
+
name: item.question,
|
|
47
|
+
acceptedAnswer: { '@type': 'Answer', text: item.answer },
|
|
48
|
+
})),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const howToSchema: WithContext<any> = {
|
|
52
|
+
'@context': 'https://schema.org',
|
|
53
|
+
'@type': 'HowTo',
|
|
54
|
+
name: title,
|
|
55
|
+
description,
|
|
56
|
+
step: howToData.map((step, i) => ({
|
|
57
|
+
'@type': 'HowToStep',
|
|
58
|
+
position: i + 1,
|
|
59
|
+
name: step.name,
|
|
60
|
+
text: step.text,
|
|
61
|
+
})),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
65
|
+
'@context': 'https://schema.org',
|
|
66
|
+
'@type': 'SoftwareApplication',
|
|
67
|
+
name: title,
|
|
68
|
+
description,
|
|
69
|
+
applicationCategory: 'UtilityApplication',
|
|
70
|
+
operatingSystem: 'All',
|
|
71
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
72
|
+
inLanguage: 'de',
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const content: ToolLocaleContent<PythagoreanRightAngleCalculatorUI> = {
|
|
76
|
+
slug,
|
|
77
|
+
title,
|
|
78
|
+
description,
|
|
79
|
+
faqTitle: 'Häufig gestellte Fragen',
|
|
80
|
+
faq: faqData,
|
|
81
|
+
bibliography,
|
|
82
|
+
howTo: howToData,
|
|
83
|
+
schemas: [faqSchema, howToSchema, appSchema],
|
|
84
|
+
seo: [
|
|
85
|
+
{ type: 'title', text: 'Der Satz des Pythagoras in der Praxis', level: 2 },
|
|
86
|
+
{ type: 'paragraph', html: 'Ein perfekter 90-Grad-Winkel ist die Grundlage für Qualitätsbau. Wände müssen senkrecht stehen, Fundamente müssen rechtwinklig sein und Rahmen müssen fluchten. Der Satz des Pythagoras bietet eine mathematisch garantierte Methode: a² + b² = c².' },
|
|
87
|
+
{ type: 'title', text: 'Warum die 3-4-5-Regel funktioniert', level: 3 },
|
|
88
|
+
{ type: 'paragraph', html: 'Die 3-4-5-Regel ist das einfachste pythagoreische Tripel. Egal, ob Sie in Zoll, Fuß oder einer anderen Einheit messen: Seiten von 3, 4 und 5 Einheiten garantieren einen 90-Grad-Winkel. Dies ist mathematisch bewiesen und seit Jahrhunderten im Bauwesen erprobt.' },
|
|
89
|
+
{ type: 'title', text: 'Präzision ohne Spezialwerkzeug', level: 3 },
|
|
90
|
+
{ type: 'paragraph', html: 'Im Gegensatz zu Wasserwaagen oder Winkeln, die brechen oder sich verstellen können, ist der Satz des Pythagoras unveränderlich. Mit nur einem Maßband können Sie jede Ecke in jedem Maßstab prüfen. Dieser Rechner macht Kopfrechnen überflüssig und sorgt für Genauigkeit.' },
|
|
91
|
+
{ type: 'title', text: 'Von der Theorie zur praktischen Anleitung', level: 3 },
|
|
92
|
+
{ type: 'paragraph', html: 'Dieser Rechner wandelt abstrakte Mathematik in praktische Anweisungen für die Baustelle um. Wenn Ihre Diagonale nicht stimmt, sagt er Ihnen genau, um wie viel und in welche Richtung Sie korrigieren müssen. Machen Sie Theorie zu echten Ergebnissen vor Ort.' },
|
|
93
|
+
],
|
|
94
|
+
ui: {
|
|
95
|
+
titleMain: 'Winkel-Rechner (Pythagoras)',
|
|
96
|
+
labelInputData: 'Messungen',
|
|
97
|
+
labelUnitSelection: 'Einheit',
|
|
98
|
+
btnUnitInches: 'Zoll',
|
|
99
|
+
btnUnitFeet: 'Fuß',
|
|
100
|
+
btnUnitCentimeters: 'Zentimeter',
|
|
101
|
+
labelSideA: 'Seite A',
|
|
102
|
+
labelSideB: 'Seite B',
|
|
103
|
+
labelMeasuredDiagonal: 'Gemessene Diagonale (optional)',
|
|
104
|
+
labelResults: 'Ergebnisse',
|
|
105
|
+
labelIdealDiagonal: 'Ideale Diagonale',
|
|
106
|
+
labelDeviation: 'Abweichung',
|
|
107
|
+
labelStatus: 'Status',
|
|
108
|
+
labelVerification: 'Winkel-Prüfung',
|
|
109
|
+
btnClear: 'Löschen',
|
|
110
|
+
btnCopyResults: 'Ergebnisse kopieren',
|
|
111
|
+
labelPresets: 'Schnellwahl',
|
|
112
|
+
unitInches: 'in',
|
|
113
|
+
unitFeet: 'ft',
|
|
114
|
+
unitCentimeters: 'cm',
|
|
115
|
+
tooltipOptional: 'Geben Sie Ihre gemessene Diagonale ein, um den 90-Grad-Winkel zu prüfen',
|
|
116
|
+
tooltipPresets: '3-4-5-Regel in verschiedenen Maßstäben',
|
|
117
|
+
statusPerfect: 'Perfekter 90-Grad-Winkel',
|
|
118
|
+
statusAcceptable: 'Akzeptable Abweichung',
|
|
119
|
+
statusWarning: 'Geringe Abweichung',
|
|
120
|
+
statusError: 'Nicht rechtwinklig',
|
|
121
|
+
statusReady: 'Bereit',
|
|
122
|
+
msgIdealCalculated: 'Ideale Diagonale berechnet',
|
|
123
|
+
actionOpen: 'Öffnen',
|
|
124
|
+
actionClose: 'Schließen',
|
|
125
|
+
descLarger: 'größer',
|
|
126
|
+
descSmaller: 'kleiner',
|
|
127
|
+
descCorrection: 'Korrektur erforderlich',
|
|
128
|
+
},
|
|
129
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { WithContext, FAQPage, SoftwareApplication } from 'schema-dts';
|
|
2
|
+
import type { ToolLocaleContent } from '../../../types';
|
|
3
|
+
import type { PythagoreanRightAngleCalculatorUI } from '../ui';
|
|
4
|
+
import { bibliography } from '../bibliography';
|
|
5
|
+
|
|
6
|
+
const slug = 'pythagorean-right-angle-calculator-3-4-5-rule';
|
|
7
|
+
const title = 'Pythagorean Right Angle Calculator: 3 4 5 Rule for Perfect Squares';
|
|
8
|
+
const description = 'Verify if structures are perfectly squared at 90° using the Pythagorean theorem and 3-4-5 rule. Essential tool for construction, carpentry, and DIY projects.';
|
|
9
|
+
|
|
10
|
+
const faqData = [
|
|
11
|
+
{
|
|
12
|
+
question: 'What is the 3-4-5 rule?',
|
|
13
|
+
answer: 'The 3-4-5 rule is a simple Pythagorean triple. If a right triangle has sides of 3, 4, and 5 units in any scale, the angle between the shorter sides is exactly 90 degrees. This field-tested method has been used in construction for centuries.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
question: 'How do I use this calculator?',
|
|
17
|
+
answer: 'Enter the lengths of the two walls (sides A and B) that form the corner. The calculator shows what the diagonal should be for a perfect 90-degree angle. Then measure your actual diagonal and enter it to verify if your corner is truly square.',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
question: 'What if my diagonal is different?',
|
|
21
|
+
answer: 'If your measured diagonal differs from the ideal, the calculator shows the deviation. Green means perfect, yellow means acceptable, red means out of square. It also tells you whether to open or close the angle.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
question: 'Is this accurate enough for construction?',
|
|
25
|
+
answer: 'Yes. The Pythagorean theorem is mathematically exact. With a tape measure, you can achieve construction-grade accuracy without specialized tools or skill.',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
question: 'Can I switch between inches and feet?',
|
|
29
|
+
answer: 'Yes. Choose inches for small projects or feet for larger structures. All values convert instantly without losing data.',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const howToData = [
|
|
34
|
+
{ name: 'Select your unit', text: 'Choose inches for detailed work or feet for larger structures. You can switch anytime without losing data.' },
|
|
35
|
+
{ name: 'Measure both sides', text: 'Measure the length of the two walls (sides A and B) that form the corner you want to check.' },
|
|
36
|
+
{ name: 'Check the ideal diagonal', text: 'The calculator shows you what the diagonal must be for a perfect 90-degree angle.' },
|
|
37
|
+
{ name: 'Measure your diagonal', text: 'Use a tape measure to measure your actual diagonal. Enter it in the optional field.' },
|
|
38
|
+
{ name: 'Read the status', text: 'Green = perfect square. Yellow = acceptable. Red = out of square. Adjust as suggested.' },
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
const faqSchema: WithContext<FAQPage> = {
|
|
42
|
+
'@context': 'https://schema.org',
|
|
43
|
+
'@type': 'FAQPage',
|
|
44
|
+
mainEntity: faqData.map((item) => ({
|
|
45
|
+
'@type': 'Question',
|
|
46
|
+
name: item.question,
|
|
47
|
+
acceptedAnswer: { '@type': 'Answer', text: item.answer },
|
|
48
|
+
})),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const howToSchema: WithContext<any> = {
|
|
52
|
+
'@context': 'https://schema.org',
|
|
53
|
+
'@type': 'HowTo',
|
|
54
|
+
name: title,
|
|
55
|
+
description,
|
|
56
|
+
step: howToData.map((step, i) => ({
|
|
57
|
+
'@type': 'HowToStep',
|
|
58
|
+
position: i + 1,
|
|
59
|
+
name: step.name,
|
|
60
|
+
text: step.text,
|
|
61
|
+
})),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
65
|
+
'@context': 'https://schema.org',
|
|
66
|
+
'@type': 'SoftwareApplication',
|
|
67
|
+
name: title,
|
|
68
|
+
description,
|
|
69
|
+
applicationCategory: 'UtilityApplication',
|
|
70
|
+
operatingSystem: 'All',
|
|
71
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
72
|
+
inLanguage: 'en',
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const content: ToolLocaleContent<PythagoreanRightAngleCalculatorUI> = {
|
|
76
|
+
slug,
|
|
77
|
+
title,
|
|
78
|
+
description,
|
|
79
|
+
faqTitle: 'Frequently Asked Questions',
|
|
80
|
+
faq: faqData,
|
|
81
|
+
bibliography,
|
|
82
|
+
howTo: howToData,
|
|
83
|
+
schemas: [faqSchema, howToSchema, appSchema],
|
|
84
|
+
seo: [
|
|
85
|
+
{ type: 'title', text: 'The Pythagorean Theorem in Practice', level: 2 },
|
|
86
|
+
{ type: 'paragraph', html: 'A perfect 90-degree angle is fundamental to quality construction. Walls must be perpendicular, foundations must be square, and frames must be true. The Pythagorean theorem provides a mathematically guaranteed method: a² + b² = c².' },
|
|
87
|
+
{ type: 'title', text: 'Why the 3-4-5 Rule Works', level: 3 },
|
|
88
|
+
{ type: 'paragraph', html: 'The 3-4-5 rule is the simplest Pythagorean triple. Whether you measure in inches, feet, or any other unit, sides of 3, 4, and 5 units guarantee a 90-degree angle. This has been proven mathematically and tested in construction for centuries.' },
|
|
89
|
+
{ type: 'title', text: 'Precision Without Specialized Tools', level: 3 },
|
|
90
|
+
{ type: 'paragraph', html: 'Unlike levels or squares that can break or fall out of adjustment, the Pythagorean theorem is immutable. With only a tape measure, you can verify any corner at any scale. This calculator eliminates mental math and ensures accuracy.' },
|
|
91
|
+
{ type: 'title', text: 'From Theory to Actionable Guidance', level: 3 },
|
|
92
|
+
{ type: 'paragraph', html: 'This calculator converts abstract mathematics into practical field instructions. If your diagonal is off, it tells you exactly how much and which direction to adjust. Transform theory into on-site results.' },
|
|
93
|
+
],
|
|
94
|
+
ui: {
|
|
95
|
+
titleMain: 'Pythagorean Right Angle Calculator',
|
|
96
|
+
labelInputData: 'Measurements',
|
|
97
|
+
labelUnitSelection: 'Unit',
|
|
98
|
+
btnUnitInches: 'inches',
|
|
99
|
+
btnUnitFeet: 'feet',
|
|
100
|
+
btnUnitCentimeters: 'centimeters',
|
|
101
|
+
labelSideA: 'Side A',
|
|
102
|
+
labelSideB: 'Side B',
|
|
103
|
+
labelMeasuredDiagonal: 'Measured diagonal (optional)',
|
|
104
|
+
labelResults: 'Results',
|
|
105
|
+
labelIdealDiagonal: 'Ideal diagonal',
|
|
106
|
+
labelDeviation: 'Deviation',
|
|
107
|
+
labelStatus: 'Status',
|
|
108
|
+
labelVerification: 'Square verification',
|
|
109
|
+
btnClear: 'Clear',
|
|
110
|
+
btnCopyResults: 'Copy results',
|
|
111
|
+
labelPresets: 'Quick presets',
|
|
112
|
+
unitInches: 'in',
|
|
113
|
+
unitFeet: 'ft',
|
|
114
|
+
unitCentimeters: 'cm',
|
|
115
|
+
tooltipOptional: 'Enter your measured diagonal to verify perfect 90 degrees',
|
|
116
|
+
tooltipPresets: '3-4-5 rule in different scales',
|
|
117
|
+
statusPerfect: 'Perfect 90 degree angle',
|
|
118
|
+
statusAcceptable: 'Acceptable deviation',
|
|
119
|
+
statusWarning: 'Minor deviation',
|
|
120
|
+
statusError: 'Out of square',
|
|
121
|
+
statusReady: 'Ready',
|
|
122
|
+
msgIdealCalculated: 'Diagonal ideal calculated',
|
|
123
|
+
actionOpen: 'Open',
|
|
124
|
+
actionClose: 'Close',
|
|
125
|
+
descLarger: 'larger',
|
|
126
|
+
descSmaller: 'smaller',
|
|
127
|
+
descCorrection: 'Correction needed',
|
|
128
|
+
},
|
|
129
|
+
};
|