JSFiddle - React, Tailwind, and code Playground

by Michael Prosser

JavaScript

let lowerLength = 0.35;
let upperLength = 0.3;
let armLength = 0.65;

let distance = 0.035; // minimum andgle should be 0.035 so no negative outputs are reacted because the triangle is scalene



let A = Math.cos(((upperLength*upperLength) + (distance*distance) - (lowerLength*lowerLength))/(2*lowerLength*distance));
let B = Math.cos(((distance*distance) + (lowerLength*lowerLength) - (upperLength*upperLength))/(2*distance*lowerLength));

let C = Math.PI-A-B;



alert(A);
alert(B);
alert(C);