(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
function calculateAllCrossProduct(points) { | |
var lastSign = null; | |
for (var i = 2; i < points.length; i++) { | |
//calculate crossproduct from 3 consecutive points | |
var crossproduct = calculateCrossProduct(points[i - 2], points[i - 1], points[i]); | |
console.log(i + ". crossproduct from ("+ points[i - 2].x +" "+points[i - 1].x +" "+points[i].x +"): " + crossproduct); | |
var currentSign = Math.sign(crossproduct); | |
if (lastSign == null) { | |
//last sign init |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.