import React, { useState } from 'react'; const SlopeInterceptWidget: React.FC = () => { const [m, setM] = useState(2); const [b, setB] = useState(1); // Visualization config const range = 10; const scale = 25; // px per unit const center = 150; const toPx = (val: number, isY = false) => isY ? center - val * scale : center + val * scale; // Points for triangle const p1 = { x: 0, y: b }; const p2 = { x: 1, y: m * 1 + b }; // Triangle vertex (1, b) const p3 = { x: 1, y: b }; return (
Rate of Change (Rise / Run)
Starting Value (when x=0)