介绍
本 2D 函数图像绘制器深度集成 math.js 与 function-plot 纯前端渲染引擎,支持单屏多函数方程绘制、微积分导数切线实时计算、定积分面积着色及高清图片导出,适配各类屏幕及副屏展示。
.fg-grid-layout { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; } @media (max-width: 860px) { .fg-grid-layout { grid-template-columns: 1fr; } } /* 侧边控制面板 */ .fg-panel { background: rgba(15, 23, 42, 0.7); border: 1px solid rgba(51, 65, 85, 0.6); border-radius: 12px; padding: 16px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); } .fg-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #38bdf8; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; } /* 函数卡片 */ .fn-card { background: #090e1f; border: 1px solid #1e293b; border-radius: 10px; padding: 12px; margin-bottom: 10px; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); position: relative; } .fn-card:hover { border-color: #334155; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); } .fn-color-badge { width: 20px; height: 20px; border-radius: 5px; cursor: pointer; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, 0.3); background-color: transparent; padding: 0; } .fn-input { background: #030712 !important; border: 1px solid #1e293b !important; color: #38bdf8 !important; font-family: 'JetBrains Mono', Consolas, monospace !important; font-weight: 600 !important; font-size: 13px !important; border-radius: 6px; padding: 5px 8px; width: 100%; transition: border-color 0.15s; } .fn-input:focus { border-color: #38bdf8 !important; outline: none; box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15); } .fn-type-badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; font-family: 'JetBrains Mono', Consolas, monospace; font-weight: 600; } /* 画布容器 */ .plot-container-wrapper { position: relative; background: #020617; border: 1px solid #1e293b; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); height: 720px; display: flex; flex-direction: column; } @media (max-width: 768px) { .plot-container-wrapper { height: 500px; } } #plotTarget { width: 100%; height: 100%; display: block; cursor: crosshair; user-select: none; touch-action: none; } /* function-plot SVG 深度暗黑终端样式定制 */ #plotTarget svg.function-plot { font-family: 'JetBrains Mono', Consolas, monospace !important; background-color: #020617 !important; } #plotTarget svg.function-plot text { fill: #94a3b8 !important; font-size: 11px !important; font-family: 'JetBrains Mono', Consolas, monospace !important; } #plotTarget svg.function-plot .x.axis-label, #plotTarget svg.function-plot .y.axis-label { fill: #38bdf8 !important; font-weight: 700 !important; font-size: 13px !important; } #plotTarget svg.function-plot .domain { stroke: #475569 !important; stroke-width: 1.5px !important; } #plotTarget svg.function-plot .origin { stroke: #334155 !important; stroke-width: 1.5px !important; } #plotTarget svg.function-plot .tick line { stroke: rgba(51, 65, 85, 0.45) !important; stroke-dasharray: 2, 2; } #plotTarget svg.function-plot .tip-x-line, #plotTarget svg.function-plot .tip-y-line { stroke: rgba(56, 189, 248, 0.7) !important; stroke-dasharray: 3, 3 !important; stroke-width: 1.2px !important; } #plotTarget svg.function-plot .tip circle { fill: #38bdf8 !important; stroke: #ffffff !important; stroke-width: 2px !important; } #plotTarget svg.function-plot .derivative path { stroke-dasharray: 4, 4 !important; stroke: #c084fc !important; stroke-width: 1.5px !important; } #plotTarget svg.function-plot path.line { stroke-linecap: round !important; stroke-linejoin: round !important; } /* 画布浮动 HUD 控制条 */ .canvas-hud { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 6px; background: rgba(11, 19, 41, 0.88); backdrop-filter: blur(8px); border: 1px solid #334155; padding: 4px 8px; border-radius: 8px; z-index: 10; } .hud-btn { background: #1e293b; color: #94a3b8; border: 1px solid #334155; border-radius: 6px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; transition: all 0.15s; } .hud-btn:hover { background: #38bdf8; color: #020617; border-color: #38bdf8; } .hud-btn.active { background: #0284c7; color: #ffffff; border-color: #38bdf8; } /* 坐标准星浮层 */ .coord-hud { position: absolute; bottom: 14px; left: 14px; background: rgba(2, 6, 23, 0.92); border: 1px solid #1e293b; backdrop-filter: blur(8px); border-radius: 8px; padding: 8px 14px; font-family: 'JetBrains Mono', Consolas, monospace; font-size: 12px; color: #94a3b8; pointer-events: none; z-index: 10; line-height: 1.6; max-width: 80%; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); } .preset-chip { background: #0f172a; border: 1px solid #1e293b; border-radius: 6px; padding: 5px 9px; font-size: 12px; color: #cbd5e1; cursor: pointer; transition: all 0.15s; display: inline-block; margin: 0 4px 6px 0; user-select: none; } .preset-chip:hover { background: #0284c7; border-color: #38bdf8; color: #ffffff; transform: translateY(-1px); } .calc-badge { background: #030712; border: 1px dashed #334155; border-radius: 6px; padding: 3px 8px; font-size: 11px; font-family: 'JetBrains Mono', Consolas, monospace; color: #a855f7; display: inline-flex; align-items: center; gap: 4px; } /* 虚拟数学键盘按钮 */ .key-btn { background: #090e1f; border: 1px solid #1e293b; color: #cbd5e1; font-family: 'JetBrains Mono', Consolas, monospace; font-size: 11px; border-radius: 4px; padding: 3px 6px; cursor: pointer; transition: all 0.12s; } .key-btn:hover { background: #1e293b; border-color: #38bdf8; color: #38bdf8; }
x^2 - 2x + 1, x^3 - 3xexp(-x/2), log(x), ln(x)sin(x), tan(x), tanh(x)sinc(x) 或 sin(x)/xx^2 + y^2 = 25, x^2/16 + y^2/9 = 1x^2 - y^2 = 1, y^2 = 4x(x^2+y^2-4)^3 - x^2*y^3 = 0y^2 = x^3 - 3x + 3r = 2 * (1 - cos(theta))r = 3 * sin(2*theta)r = 0.5 * thetax=4*cos(t)^3, y=4*sin(t)^3本 2D 函数图像绘制器深度集成 math.js 与 function-plot 纯前端渲染引擎,支持单屏多函数方程绘制、微积分导数切线实时计算、定积分面积着色及高清图片导出,适配各类屏幕及副屏展示。