Skip to content

Commit ff3d293

Browse files
committed
Fix last loop
1 parent 5f73841 commit ff3d293

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

media/src/objects/Function.svelte

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -215,25 +215,13 @@
215215
216216
scene.add(point);
217217
218-
// Compile main function
219-
// let func = $derived.by(() => {
220-
// const z = math.parse(params.z).compile();
221-
// return (x, y, t) => z.evaluate({ x, y, t });
222-
// });
223-
224218
let A = $derived(math.evaluate(params.a));
225219
let B = $derived(math.evaluate(params.b));
226220
let C = $derived(mathToJSFunction(params.c, ['x']));
227221
let D = $derived(mathToJSFunction(params.d, ['x']));
228222
let func = $derived(mathToJSFunction(params.z, ['x', 'y', 't']));
229223
230224
const tangentVectors = function () {
231-
// const arrowParams = {
232-
// radiusTop: gridStep / 10,
233-
// radiusBottom: gridStep / 20,
234-
// heightTop: gridStep / 7,
235-
// };
236-
237225
const dx = 0.001;
238226
239227
const x = point.position.x;
@@ -409,13 +397,6 @@
409397
};
410398
411399
const meshLines = function (rNum = 10, cNum = 10, nX = 50) {
412-
// let { a, b, c, d, t0, t1 } = rData;
413-
414-
// const A = math.parse(a).evaluate();
415-
// const B = math.parse(b).evaluate();
416-
// const C = math.parse(c).compile();
417-
// const D = math.parse(d).compile();
418-
419400
const du = (B - A) / rNum;
420401
const dx = (B - A) / lcm(nX, cNum);
421402
const points = [];
@@ -462,8 +443,9 @@
462443
);
463444
// args['y'] = v;
464445
let nextZero = zs.shift();
465-
for (let u = A; u <= B - dx + tol; u += dx) {
466-
// args.x = u;
446+
for (let k = 0; k < lcm(nX, cNum); k++) {
447+
const u = A + k * dx;
448+
467449
if (C(u) <= v && v <= D(u)) {
468450
points.push(new THREE.Vector3(u, v, func(u, v, tVal)));
469451
if (nextZero < u + dx) {

0 commit comments

Comments
 (0)