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

Function unit

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

Source from the content-addressed store, hash-verified

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); };
39
40/**
41 * Das Kameraziel fuer einen Pfad.

Callers 1

pathFrameFunction · 0.70

Calls 1

scaleFunction · 0.85

Tested by

no test coverage detected