angles and shapes

by Richard Hunter

HTML

<div class="foo"></div>

JavaScript

const a = 100;
const b = 100;

function toRadians(degrees) {
  return degrees * (Math.PI / 180);
}

function toDeg(radians) {
  return radians * (180 / Math.PI);
}

// TOA
//tan x = opposite / adjacent
// adjacent = opposite / tanx

const result = 100 / Math.tan(toRadians(45))
console.log(result);

let tanX = 100 / 100;
console.log(toDeg(Math.atan(tanX)));