import { RADIAN, BOTTOM_INDICATOR_HEIGHT_AS_PERCENTAGES, TOP_INDICATOR_HEIGHT_AS_PERCENTAGES, INDICATOR_WIDTH_AS_PERCENTAGES } from './constants';
export var getGaugeIndicatorCoords = function (value, data, cx, cy, oR, iR) {
    var total = data.reduce(function (sum, _a) {
        var value = _a.value;
        return sum + value;
    }, 0);
    var angle = 180.0 * (1 - Math.min(total, value) / total);
    var width = INDICATOR_WIDTH_AS_PERCENTAGES * oR;
    var sin = Math.sin(-RADIAN * angle);
    var cos = Math.cos(-RADIAN * angle);
    var x1 = cx + (iR - BOTTOM_INDICATOR_HEIGHT_AS_PERCENTAGES * oR) * cos + width * sin;
    var y1 = cy + (iR - BOTTOM_INDICATOR_HEIGHT_AS_PERCENTAGES * oR) * sin - width * cos;
    var x2 = cx + (iR - BOTTOM_INDICATOR_HEIGHT_AS_PERCENTAGES * oR) * cos - width * sin;
    var y2 = cy + (iR - BOTTOM_INDICATOR_HEIGHT_AS_PERCENTAGES * oR) * sin + width * cos;
    var x3 = cx + (oR + TOP_INDICATOR_HEIGHT_AS_PERCENTAGES * oR) * cos;
    var y3 = cy + (oR + TOP_INDICATOR_HEIGHT_AS_PERCENTAGES * oR) * sin;
    return { x1: x1, y1: y1, x2: x2, y2: y2, x3: x3, y3: y3 };
};
