JSFiddle - React, Tailwind, and code Playground

by Michael Prosser

JavaScript

// get hypotenuse from base and 2 angles

A = 90;
B = 45;
C = 180 - A - B;

// we now have 3 angles

base = 200;

height = (base * Math.sin(A))/Math.sin(C);

hypotenuse = Math.sqrt(Math.pow(height,2) + Math.pow(base,2));


alert(hypotenuse);