[r]
(1)function main // Tạo biến ix = iy = r1 = r2 = // Vẽ hai đường tròn (I) và (K) tiếp xúc ngoài H set_paper Paper, 2, 0xFF00FF appear Point, ix, iy, "I", rightbelow circle ix, iy, r1 get_point &hx, &hy, ix, iy, 0, r1 appear Point, hx, hy, "H", leftbelow get_point &kx, &ky, hx, hy, 0, r2 circle kx, ky, r2 appear Point, kx, ky, "K", below line ix, iy, kx, ky // Vẽ đường tròn đường kính BC set_paper Draft, appear Text, 8.25, 0.5, "Kéo dài đường nối tâm IK", get_point &bx, &by, ix, iy, 180, r1 get_point &cx, &cy, kx, ky, 0, r2 create_line bx, by, cx, cy appear Pencil, bx, by appear Point, bx, by, "B", left disappear Pencil appear Pencil, cx, cy appear Point, cx, cy, "C", right disappear Pencil disappear Text appear Text, 8.25, 0.5, "Lấy trung điểm O BC và vẽ đường tròn (O) đường kính BC", get_angle &angle, bx, by, cx, cy ox = (bx+cx)/2 oy = (by+cy)/2 appear Ruler move Ruler, bx, by, angle appear Pencil, ox, oy appear Point, ox, oy, "O", below disappear Pencil disappear Ruler disappear Text appear Compa move Compa, ox, oy, -180 call Compa.OpenCompa, r1+r2 rotate_compa Compa, r1+r2, 180 disappear Compa // Vẽ tiếp tuyến chung ngoài (I) và (K) appear Text, 8.25, 0.5, "Vẽ đường thẳng vuông góc với BC H cắt đường tròn đường kính BC A", lenHA = sqrt((r1+r2)^2 - (r2-r1)^2) get_point &ax, &ay, hx, hy, 90, lenHA create_line3 hx, hy, ax, ay appear Pencil, ax, ay appear Point, ax, ay, "A", rightbelow disappear Pencil (2) note_angle disappear 1, "", cx, cy, hx, hy, ax, ay Text appear Text, 8.25, 0.5, "Nối A với B cắt (I) E, nối A với C cắt (K) F, EF là tiếp tuyến chung ngoài (I) và (K)", create_line bx, by, ax, ay create_line ax, ay, cx, cy get_intersection2 &ekx, &eky, &ex, &ey, bx, by, ax, ay, ix, iy, r1 get_intersection2 &fkx, &fky, &fx, &fy, cx, cy, ax, ay, kx, ky, r2 appear Pencil, ex, ey appear Point, ex, ey, "E", leftabove disappear Pencil appear Pencil, fx, fy appear Point, fx, fy, "F", rightabove disappear Pencil set_paper Paper, 2, 0xFF00FF create_line ex, ey, fx, fy disappear Text // Bài tập 42 (SGK-128) wait_click get_intersection1 &mx, &my, ax, ay, hx, hy, ex, ey, fx, fy appear Pencil, mx, my appear Point, mx, my, "M", leftabove disappear Pencil create_line ex, ey, hx, hy create_line ex, ey, ix, iy create_line ix, iy, mx, my create_line fx, fy, hx, hy create_line fx, fy, kx, ky create_line kx, ky, mx, my get_intersection1 &e'x, &e'y, mx, my, ix, iy, ex, ey, hx, hy get_intersection1 &f'x, &f'y, mx, my, kx, ky, hx, hy, fx, fy appear Pencil, e'x, e'y appear Point, e'x, e'y, "E'", left disappear Pencil appear Pencil, f'x, f'y appear Point, f'x, f'y, "F'", right disappear Pencil note_angle 1, "", ix, iy, ex, ey, fx, fy note_angle 1, "", ex, ey, fx, fy, kx, ky set_paper Paper, 2, 0x00CC00 get_angle &angle, ix, iy, kx, ky o'x = (ix+kx)/2 o'y = (iy+ky)/2 appear Ruler move Ruler, ix, iy, angle appear Pencil, o'x, o'y appear Point, o'x, o'y, "O'", below disappear Pencil disappear Ruler create_line mx, my, o'x, o'y end (3)