import type { NodeDef } from '../../NodeRegistry'; import { asNumber } from '../../values'; import { num } from '../shared'; export const Length: NodeDef = { type: 'Length', label: 'Length', category: 'data', description: 'Length of the vector (x, y).', inputs: [num('x'), num('y')], outputs: [num('result')], params: [], run: (_ctx, inputs) => ({ outputs: { result: Math.hypot(asNumber(inputs.x), asNumber(inputs.y)) } }), };