@fimbul-works/vec
Version:
A comprehensive TypeScript vector math library providing 2D, 3D, and 4D vector operations with a focus on performance and type safety.
17 lines (16 loc) • 567 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.lerp3D = void 0;
/**
* Performs linear interpolation between two vectors.
* @param {ArrayVector3D} xyz1 - First vector as `[x, y, z]`
* @param {ArrayVector3D} xyz2 - Second vector as `[x, y, z]`
* @param {number} t - Interpolation parameter
* @returns {ArrayVector3D} The interpolated vector
*/
const lerp3D = (xyz1, xyz2, t) => [
xyz1[0] + (xyz2[0] - xyz1[0]) * t,
xyz1[1] + (xyz2[1] - xyz1[1]) * t,
xyz1[2] + (xyz2[2] - xyz1[2]) * t,
];
exports.lerp3D = lerp3D;