Forwarded from dnaugsuz
是的。
但是如果真的足够重视,我会选择让人家 edit 一下然后重发 send w/o sound
但是如果真的足够重视,我会选择让人家 edit 一下然后重发 send w/o sound
Forwarded from Deleted Account
这是我自己的 activity,那 3 个 app 是运行在 adb process 创建的 virtual display 中的,我只是拿了 3 个 surface 画在一起,然后转发一下触摸事件
#draft #math #gui 想下以我能理解的技术,便于使用和拓展的函数图数据编辑器该怎么做
浮标因为有数轴往往不需要,所以界面基本就函数列表、配置按钮两个控件。
函数列表还是
我要写必须支持(至少是)部分解析的符号系统,应该支持初中程度的等式化简,但不一定支持非线性绘图;反正一定要能做内联/外提/变量更新检测 之类的东西
所以配置页应该支持 eval 表达式,还有 LaTeX 的便利转换什么的
然后支持 URL 参数像这种
浮标因为有数轴往往不需要,所以界面基本就函数列表、配置按钮两个控件。
函数列表还是
<details> ,头部 summary 支持拖拽,含两个按钮,是 对齐到边缘/换边 、最小化到配置按钮旁我要写必须支持(至少是)部分解析的符号系统,应该支持初中程度的等式化简,但不一定支持非线性绘图;反正一定要能做内联/外提/变量更新检测 之类的东西
所以配置页应该支持 eval 表达式,还有 LaTeX 的便利转换什么的
然后支持 URL 参数像这种
&text=group1: y(x)=sin(x); y=tan; x(y)=y+2 [x in 10..20 step 2]; group2: y(x, a=1)=x*a [x in 0..+-a]; animate a -10..10 once/*infinite,cycle,bounce*/; disable last/*y_3*/
&text=:a.txt
&style=.d2-pointer-info{display:none}
&axis=xy/x/y
&grid=no/yes/full/round
&xrange=0..+-10sy=h; g. textBaseline E bottom";
] else [ signInbound = -1; ] 1 No idea to improve this .g.moveTo(0, sy); g. lineTo(w, sy);for (x=x0; x<ww; x+=x_ delta) [
let Sx = fromPx(x);
lineVert(sx, sy, markerD);
if (hasL) [
let x=x0, x1=ww+leg_ deltaX;for (; x<x1; x+=leg_ deltaX) [
let sx = fromPx(x);
g.fillText(showNum(x), sx, sy+markerD* (2*signInbound));lineVert(sx, sy, markerD*2)
if (someGrid) lineVert(sx, 0, h);
]
]
strokeAxes();
if (axis & 0b100) [
newPath(); g.textAlign = "left";let sx = fromPx(0);
let markerD = markerW; 11 slight different from aboveif (sx<=0) [ sx=0; ]else if (sx>w)
sx=w; markerD= -markerW;g.textAlign = "right";
g.moveTo(sx, 0); g. lineTo(sx, h);if (hasL) f
let y=ybounds[0], y1=ybounds[1]+leg_ deltaY;for (; y<y1; y+=leg deltaY) l
let sy = fromPy(y);
g. fillText(showNum(y), sx+markerD*2, sy+markerD);lineHorz(sx, sy, markerD*2);
if (someGrid) lineHorz(0, sy, w);
]
if (allGrid) [
let d= (y1-y) 1 miniorGridLDiv;
for (y=ybounds[0]; y<y1; y+=d) iineHorz(, fromPy(v)l w);
strokeAxes();
]
g. beginPath();
for (x=x0, x1=ww; x<x1; x+=x_ delta) f
y = y_func(x);
if (y<ybounds[0]) ybounds[0]=y;
else if (y>ybounds[1]) ybounds[1]=y;
g. lineTo(fromPx(x); fromPy(y)); 11 Draw func!
g.strokeStyle = color;g.stroke();
if (fromPx(x1-(x-x delta)) > 1) [ 11 Render hor-end line!
newPath()
g. moveTo(fromPx(x-x_ delta), fromPy(y));g.strokeStyle = cfg.noL inecolor;g. lineTo(w, fromPy(y));stroke( );
);
]
g.closePath();if. (pressed[km_ scale]) i
if (v<0) v=1/-v; 11 scale down
if (!pressed[km_ _xmove]) scale[0]*=v; scale[1]*=v/*y-only*/;] else [
vp[(pressed[km_ .xmove])? 0 : 1] += v*cfg. moveSpeed;
onDraw. begin();]);
bindkeyNavigation(eGraph, vp_ .xy, scale_ _xy, "Shift", "Control");</script>
<script>
const y_ funcs = [["sin", Math.sin, 0.01, "red"], ["x**2", x=>x*x, 0.1,const idf = (from, into) => x => from(into(from(x)));
onDraw.begin = () => f
let [w, h] = wh;
g.clearRect(0,0, w,h);
let [vx, vy] = vp_ xy; 11 unit: pxlet [kx, ky] = scale_ xy; :
const intoPx = x => (x-vx)/w*kx, fromPx = px => px/kx*w+vx,
fromPy = y => h-h*(y+vy/w*ky/ *move speed*/ )/ky,11 orig func: -((y+vy/w"ky)/ky)*h +h
intoPy F py => (-(py-h)/h)*ky/ky-vy/w 1/-(ky*(h*vy-h*w+py*w)/(h*w))for (let [code, y_ func, x_ _delta, color] of y_ funcs) [
g.strokeStyle = color;g. beginPath();
for (let x=intoPx(0), x1=intoPx(w); x<x1; x+=x_ delta) l
let y = y_func(x);
g. lineTo(idf(fromPx, intoPx)(x), idf(fromPy, intoPy)(y));