math fixed

This commit is contained in:
2026-01-01 15:57:09 +10:00
parent 9fef1e5b0d
commit 5d7ecb1f13

View File

@@ -108,8 +108,12 @@ function getCalculations() {
sideAngle = inputsB.angle;
baseAngle = 180 - 2 * sideAngle;
}
radius = Math.sqrt(((2 * lengths[1]) - lengths[0]) / ((2 * lengths[1]) - lengths[0])) * lengths[0] / 2;
let a = lengths[0];
let b = lengths[1];
let p = (a + b + b) / 2;
radius = Math.sqrt((p - a) * (p - b) * (p - b) / p);
heights[0] = lengths[1] * Math.sin(deg2rad(sideAngle));
heights[1] = lengths[0] * Math.sin(deg2rad(baseAngle));