MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / controlPointOf

Function controlPointOf

graph-ui/src/agents/agent-motion.ts:175–191  ·  view source on GitHub ↗
(from: MotionPoint, to: MotionPoint, sign: number)

Source from the content-addressed store, hash-verified

173 * sondern ein Koerper, der kurz naeher steht.
174 */
175export function controlPointOf(from: MotionPoint, to: MotionPoint, sign: number): MotionPoint {
176 const dx = to.x - from.x;
177 const dy = to.y - from.y;
178 const length = Math.hypot(dx, dy);
179 const midX = (from.x + to.x) / 2;
180 const midY = (from.y + to.y) / 2;
181 const midZ = (from.z + to.z) / 2;
182 if (length === 0) {
183 return { x: midX, y: midY, z: midZ };
184 }
185 const offset = TRANSITION_BEND * length * sign;
186 return {
187 x: midX + (-dy / length) * offset,
188 y: midY + (dx / length) * offset,
189 z: midZ,
190 };
191}
192
193/** Ein Punkt der Bahn, bei `t` zwischen 0 und 1. Quadratische Bezierkurve. */
194export function transitionPointAt(

Callers 2

AgentBodyFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected