June 2015
Beginner
354 pages
8h 23m
English
Let's increase the thickness of those intersected lines so we can distinguish them in the Canvas
untangle.drawing.js file in the text editor.thinLineThickness variable as the default line thickness. We add the following code to define a thickness for bold lines:untangleGame.boldLineThickness = 5;
untangle.data.js file. We create a function to check whether the given two lines intersect. Add the following functions to the end of the JavaScript file:untangleGame.isIntersect = function(line1, line2) { // convert line1 to general form of line: Ax+By = C var a1 = line1.endPoint.y - line1.startPoint.y; var b1 = line1. startPoint.x - line1.endPoint.x; var c1 = a1 * line1.startPoint.x ...Read now
Unlock full access