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

Function cross

graph-ui/src/galaxy/path-frame.ts:35–35  ·  view source on GitHub ↗
(a: Vec3, b: Vec3)

Source from the content-addressed store, hash-verified

33const sub = (a: Vec3, b: Vec3): Vec3 => ({ x: a.x - b.x, y: a.y - b.y, z: a.z - b.z });
34const dot = (a: Vec3, b: Vec3) => a.x * b.x + a.y * b.y + a.z * b.z;
35const cross = (a: Vec3, b: Vec3): Vec3 => ({ x: a.y * b.z - a.z * b.y, y: a.z * b.x - a.x * b.z, z: a.x * b.y - a.y * b.x });
36const scale = (a: Vec3, factor: number): Vec3 => ({ x: a.x * factor, y: a.y * factor, z: a.z * factor });
37const add = (...vectors: Vec3[]): Vec3 => vectors.reduce((sum, value) => ({ x: sum.x + value.x, y: sum.y + value.y, z: sum.z + value.z }), { x: 0, y: 0, z: 0 });
38const unit = (a: Vec3): Vec3 => { const length = Math.hypot(a.x, a.y, a.z) || 1; return scale(a, 1 / length); };

Callers 1

pathFrameFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected