dg.js tangent construction example - Djordje Rakonjac / december, 2015
Try dragging point P and notice that angles stay constant. Notice that by construction 〈(P,t1,O) & 〈(P,t0,O) are orthogonal. We could have used dg.Tangent(Point, Circle) function built in dg.js
var canvas = dg.Canvas("testcanvas", { border: "1px solid #ccc"});
var axes = dg.Axes([canvas.width() / 4, canvas.height() / 1.5]).hide(false);
var p1 = dg.Point([1, 1]).label("O");
var p2 = dg.Point([4, 2]).label("B");
var c0 = dg.Circle(p1,p2);
var p3 = dg.Point([8, 3]).label("P");
var midpoint = dg.Midpoint(p1, p3).label("M");
var c1 = dg.Circle(midpoint, p3);
dg.Line(p3, p1);
var intersections = dg.Intersect(c0, c1);
intersections[0].label("t0");
intersections[1].label("t1");
dg.Line(p3, intersections[0]);
dg.Line(p3, intersections[1]);
dg.Angle(p3, intersections[0], p1);