/
index.html
376 lines (336 loc) · 12.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
---
layout: landing
title: JSXGraph
subtitle: Dynamic Mathematics with JavaScript
---
<div class="row">
<div class="col-lg-10 col-lg-offset-1 col-md-10 col-md-offset-1 jumbotron text-left">
<h3>Interactive geometry, plotting, visualization</h3>
<p>
JSXGraph is a cross-browser JavaScript library for interactive geometry,
function plotting, charting, and data visualization in the web browser.
</p>
<h3>New</h3>
<ul>
<li>March 2024: <a href="https://github.com/DylanHojnoski/obsidian-graphs/">JSXGraph is available as Obsidian plug-in</a> </li>
<li>Since 2023: <a href="/share/">Examples database</a> </li>
</ul>
<h3>Upcoming events:</h3>
<div style="text-align: left;">
<ul>
<li>Alfred Wassermann will deliver a keynote at the <a
href="https://www.oth-aw.de/forschung/forschungsprofil/forschungs-und-entwicklungsprojekte/ideal/international-meeting-of-the-stack-community-2024/">STACK
conference 2024</a>,
March 11-13, 2024</li>
<li>5. International JSXGraph conference, October 2024 (tba, free online conference)
</ul>
</div>
<h3>Past events:</h3>
<div style="text-align: left;">
<ul>
<li><a href="/conf2023">4. International JSXGraph conference, 10.-12. October 2023 (free online conference)</a>
</li>
<li> Free hybrid workshop <strong>Using JSX graphs in STACK</strong>, December 8, 2022, University of Edinburgh.
<a href="https://stack-assessment.org/Events/2022-12-08-JSXgraphSTACK/">Workshop homepage</a>
</li>
<!--
<li><strong>Next Webinar:
<a href="/wp/2021-06-01-webinar-7/">
advanced JSXGraph programming vol 7 (online)
</a>:</strong> 9. June 2021, 4 pm CEST (Central European Summer Time, UTC +2)</li>
<li><strong>Online Teacher Training Course on Programming JSXGraph</strong> May 26th - June 9th, 2021. <a href="https://forms.gle/gmDg2iqh1MDZM39u8">(free) registration</a></li>
<li><strong>3rd JSXGraph conference 2022</strong>
October 4th - 6th, 2022 (online, free) <a href="/conf2022/">conference home page</a>.</li>
-->
<li> <a href="/wp/docs/">More...</a>
</ul>
</div>
</div>
</div>
<div class="row">
<!--<div class="col-12 cont">-->
<div class="col-lg-10 col-lg-offset-1 col-md-10 col-md-offset-1 nopadding text-center">
<div class="col-sm-3 col-xs-6 text-center mybox">
<a href="https://jsfiddle.net/k60dprL4/" title="jsfiddle">
<span class="fa-stack fa-lg icon">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-jsfiddle fa-stack-1x fa-inverse"></i>
</span>
<h4>jsfiddle</h4>
get started quickly
</a>
</div>
<div class="col-sm-3 col-xs-6 text-center mybox">
<a href="https://groups.google.com/forum/#!forum/{{ site.author.googlegroups }}" title="Google groups">
<span class="fa-stack fa-lg icon">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-google fa-stack-1x fa-inverse"></i>
</span>
<h4>Google Groups</h4>
structural questions
</a>
</div>
<div class="col-sm-3 col-xs-6 text-center mybox">
<a href="https://github.com/{{ site.author.github }}" title="GitHub">
<span class="fa-stack fa-lg icon">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-github fa-stack-1x fa-inverse"></i>
</span>
<h4>GitHub</h4>
requests & bugreports
</a>
</div>
<div class="col-sm-3 col-xs-6 text-center mybox">
<a href="https://stackoverflow.com/search?tab=newest&q=jsxgraph" title="StackOverflow">
<span class="fa-stack fa-lg icon">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-stack-overflow fa-stack-1x fa-inverse"></i>
</span>
<h4>StackOverflow</h4>
coding questions
</a>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-lg-offset-1 col-md-6 col-md-offset-1">
<h4>Features</h4>
<ul>
<li> Euclidean and projective Geometry</li>
<li> Curve plotting</li>
<li> Open source</li>
<li> High-performance</li>
<li> Small footprint </li>
<li> No dependencies</li>
<li> Multi-touch support</li>
<li> Backward compatible down to IE 6</li>
</ul>
<p>
JSXGraph is implemented in pure JavaScript, does not rely on any other library,
and uses SVG, canvas (or even the ancient VML).
Special care has been taken to optimize the performance.
<!-- <p>
The new interactive geometry software sketchometry is based on JSXGraph.
-->
</p>
</div>
<div class="col-lg-4 col-md-4">
<h4>Examples</h4>
<div id='box2' class='jxgbox' style='width:320px; height:320px;'></div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-lg-offset-1 col-md-6 col-md-offset-1">
<h4>License</h4>
<p>
JSXGraph is released under the
<a href="http://www.gnu.org/licenses/licenses.html#LGPL" target="_blank">LGPL
– Lesser GNU General Public License</a> –
or the
<a href="https://github.com/jsxgraph/jsxgraph/blob/master/LICENSE.MIT" target="_blank">MIT license</a>.
</p>
</div>
<div class="col-lg-4 col-md-4">
<div id='box' class='jxgbox' style='width:320px; height:320px;'></div>
<p><a href="/wiki/index.php/Category:Examples">More examples ...</a></p>
</div>
</div> <!-- row -->
<br>
<script type='text/javascript'>
(function () {
var brd = JXG.JSXGraph.initBoard('box', { boundingbox: [-3, 3, 3, -3] });
solveQ2 = function (x1, x2, x3, off) {
var a, b, c, d;
a = 0.5;
b = -(x1 + x2 + x3);
c = x1 * x1 + x2 * x2 + x3 * x3 - 0.5 * (x1 + x2 + x3) * (x1 + x2 + x3) - off;
d = b * b - 4 * a * c;
if (Math.abs(d) < 0.00000001) d = 0.0;
return [(-b + Math.sqrt(d)) / (2.0 * a), (-b - Math.sqrt(d)) / (2.0 * a)];
}
a = brd.create('line', [[0, 0], [2, 0]], { straightFirst: false, straightLast: false, visible: false });
p0 = brd.create('point', [0, 0], { name: '', visible: false });
p1 = brd.create('glider', [1.3, 0, a], { name: 'drag me' });
b0 = -0.5;
r1 = 2 - p1.X();
b1 = 1.0 / r1;
r2 = (2.0 - r1);
b2 = 1.0 / r2;
p2 = brd.create('point', [function () { return p1.X() - 2; }, 0], { name: '', visible: false });
c0 = brd.create('circle', [p0, Math.abs(1.0 / b0)], { strokeWidth: 1, withLabel: false });
c1 = brd.create('circle', [p1, function () { return 2 - p1.X(); }], { strokeWidth: 1, withLabel: false });
c2 = brd.create('circle', [p2, function () { return p1.X(); }], { strokeWidth: 1, withLabel: false });
c0.curvature = function () { return b0; }; // constant
c1.curvature = function () { return 1 / (2 - p1.X()); };
c2.curvature = function () { return 1 / (p1.X()); };
thirdCircleX = function () {
var b0, b1, b2, x0, x1, x2, b3, bx3;
b0 = c0.curvature();
b1 = c1.curvature();
b2 = c2.curvature();
x0 = c0.midpoint.X();
x1 = c1.midpoint.X();
x2 = c2.midpoint.X();
b3 = solveQ2(b0, b1, b2, 0);
bx3 = solveQ2(b0 * x0, b1 * x1, b2 * x2, 2);
return bx3[0] / b3[0];
}
thirdCircleY = function () {
var b0, b1, b2, y0, y1, y2, b3, by3;
b0 = c0.curvature();
b1 = c1.curvature();
b2 = c2.curvature();
y0 = c0.midpoint.Y();
y1 = c1.midpoint.Y();
y2 = c2.midpoint.Y();
b3 = solveQ2(b0, b1, b2, 0);
by3 = solveQ2(b0 * y0, b1 * y1, b2 * y2, 2);
return by3[0] / b3[0];
}
thirdCircleRadius = function () {
var b0, b1, b2, b3, bx3, by3;
b0 = c0.curvature();
b1 = c1.curvature();
b2 = c2.curvature();
b3 = solveQ2(b0, b1, b2, 0);
return 1.0 / b3[0];
}
p3 = brd.create('point', [thirdCircleX, thirdCircleY], { name: '', visible: false });
c3 = brd.create('circle', [p3, thirdCircleRadius], { strokeWidth: 1, withLabel: false });
c3.curvature = function () { return 1.0 / this.radius; };
otherCirc = function (circs, level) {
var p, c, fx, fy, fr;
if (level <= 0) return;
fx = function () {
var b, x, i;
b = [];
x = [];
for (i = 0; i < 4; i++) {
b[i] = circs[i].curvature();
x[i] = circs[i].midpoint.X();
}
b[4] = 2 * (b[0] + b[1] + b[2]) - b[3];
x[4] = (2 * (b[0] * x[0] + b[1] * x[1] + b[2] * x[2]) - b[3] * x[3]) / b[4];
return x[4];
}
fy = function () {
var b, y, i;
b = [];
y = [];
for (i = 0; i < 4; i++) {
b[i] = circs[i].curvature();
y[i] = circs[i].midpoint.Y();
}
b[4] = 2 * (b[0] + b[1] + b[2]) - b[3];
y[4] = (2 * (b[0] * y[0] + b[1] * y[1] + b[2] * y[2]) - b[3] * y[3]) / b[4];
return y[4];
}
fr = function () {
var b, i;
b = [];
for (i = 0; i < 4; i++) {
b[i] = circs[i].curvature();
}
b[4] = 2 * (b[0] + b[1] + b[2]) - b[3];
if (isNaN(b[4])) {
return 1000.0;
} else {
return 1 / b[4];
}
}
p = brd.create('point', [fx, fy], { name: '', visible: false });
c = brd.create('circle', [p, fr], {
strokeWidth: 1,
fillColor: JXG.hsv2rgb((70 * level) % 360, 0.9, 0.8), highlightFillColor: JXG.hsv2rgb((70 * level) % 360, 0.9, 0.6), fillOpacity: 0.7, withLabel: false
});
c.curvature = function () { return 1 / this.radius; };
// Recursion
otherCirc([circs[0], circs[1], c, circs[2]], level - 1);
otherCirc([circs[0], circs[2], c, circs[1]], level - 1);
otherCirc([circs[1], circs[2], c, circs[0]], level - 1);
return c;
}
//-------------------------------------------------------
brd.suspendUpdate();
level = 3;
otherCirc([c0, c1, c2, c3], level);
otherCirc([c3, c1, c2, c0], level);
otherCirc([c0, c2, c3, c1], level);
otherCirc([c0, c1, c3, c2], level);
brd.unsuspendUpdate();
})();
// Euler line
(function () {
var board = JXG.JSXGraph.initBoard('box2', { boundingbox: [-1.5, 2, 1.5, -1], keepaspectratio: true });
var cerise = {
strokeColor: '#901B77',
fillColor: '#CA147A'
},
grass = {
strokeColor: '#009256',
fillColor: '#65B72E',
visible: true,
withLabel: true
},
perpendicular = {
strokeColor: 'black',
dash: 1,
strokeWidth: 1,
point: JXG.deepCopy(cerise, {
visible: true,
withLabel: true
})
},
median = {
strokeWidth: 1,
strokeColor: '#333333',
dash: 2
},
A = board.create('point', [1, 0], cerise),
B = board.create('point', [-1, 0], cerise),
C = board.create('point', [0.2, 1.5], cerise),
pol = board.create('polygon', [A, B, C], {
fillColor: '#FFFF00',
lines: {
strokeWidth: 2,
strokeColor: '#009256'
}
});
var pABC, pBCA, pCAB, i1;
perpendicular.point.name = 'H_c';
pABC = board.create('perpendicular', [pol.borders[0], C], perpendicular);
perpendicular.point.name = 'H_a';
pBCA = board.create('perpendicular', [pol.borders[1], A], perpendicular);
perpendicular.point.name = 'H_b';
pCAB = board.create('perpendicular', [pol.borders[2], B], perpendicular);
grass.name = 'H';
i1 = board.create('intersection', [pABC, pCAB, 0], grass);
var mAB, mBC, mCA;
cerise.name = 'M_c';
mAB = board.create('midpoint', [A, B], cerise);
cerise.name = 'M_a';
mBC = board.create('midpoint', [B, C], cerise);
cerise.name = 'M_b';
mCA = board.create('midpoint', [C, A], cerise);
var ma, mb, mc, i2;
ma = board.create('segment', [mBC, A], median);
mb = board.create('segment', [mCA, B], median);
mc = board.create('segment', [mAB, C], median);
grass.name = 'S';
i2 = board.create('intersection', [ma, mc, 0], grass);
var c;
grass.name = 'U';
c = board.create('circumcircle', [A, B, C], {
strokeColor: '#000000',
dash: 3,
strokeWidth: 1,
center: grass
});
var euler;
euler = board.create('line', [i1, i2], {
strokeWidth: 2,
strokeColor: '#901B77'
});
board.update();
})();
</script>