JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id=C>
<script>
function T(a,b,c,d,e,f,g,h){with(C.getContext("2d"))return beginPath(),moveTo(a,b),lineTo(c,d),lineTo(e,f),fill(),!!getImageData(g,h,1,1).data[3]}
console.log(T(10,10,100,10,10,100,15,15));
console.log(T(10,10,100,10,10,100,5,5));
</script>