import { assert } from "../../assert.js";
import { lerp } from "../../math/lerp.js";

/**
 *
 * @param {Vector3|{set:function(x:number,y:number,z:number)}} result
 * @param {number} a_x
 * @param {number} a_y
 * @param {number} a_z
 * @param {number} b_x
 * @param {number} b_y
 * @param {number} b_z
 * @param {number} fraction
 */
export function v3_lerp(
    result,
    a_x, a_y, a_z,
    b_x, b_y, b_z,
    fraction
) {
    assert.isNumber(fraction, 'fraction');

    const x = lerp(a_x, b_x, fraction);
    const y = lerp(a_y, b_y, fraction);
    const z = lerp(a_z, b_z, fraction);

    result.set(x, y, z);
}
