/**
 * Compute apex angle of an isosceles triangle (triangle with two equal sides)
 * @param {number} side length of the side
 * @param {number} base length of the base
 * @returns {number} Apex angle in radians
 */
export function computeIsoscelesTriangleApexAngle(side, base) {
    const b2 = base * base;
    const s2 = side * side;

    const upper = (2 * s2 - b2);
    const lower = (2 * s2);

    const cosAlpha = upper / lower;

    return Math.acos(cosAlpha);
}
