[r]
(1)function main // Vẽ đoạn thẳng AB set_paper Paper, 2, 0x00CC00 ax = ay = bx = 12 by = cx = cy = line ax, ay, bx, by line ax, ay, cx, cy line cx, cy, bx, by appear Point, cx, cy, "C", above appear Point, ax, ay, "A", left appear Point, bx, by, "B", below lenAB = sqrt((ax - bx)^2 + (ay - by)^2)) lenBC = sqrt((cx - bx)^2 + (cy - by)^2)) lenAC = sqrt((ax - cx)^2 + (ay - cy)^2)) r = gocA = arccos((lenAB^2 + lenAC^2 - lenBC^2)/(2*lenAB*lenAC)) gocB = arccos((lenAB^2 + lenBC^2 - lenAC^2)/(2*lenAB*lenBC)) gocC = arccos((lenAC^2 + lenBC^2 - lenAB^2)/(2*lenAC*lenBC)) // Vẽ phân giác góc A set_paper Draft appear Compa get_angle &gocAB, ax, ay, bx, by move Compa, ax, ay, gocAB - 20 call Compa.OpenCompa, r rotate_compa Compa, r, gocA + 20 get_angle get_point get_angle get_point &angle, ax, ay, bx, by &dx, &dy, ax, ay, angle, r &angle, ax, ay, cx, cy &ex, &ey, ax, ay, angle, r get_angle &gocDA, dx, dy, ax, ay move Compa, dx, dy, gocDA - 20 rotate_compa Compa, r, 50 get_angle &gocEA, ex, ey, ax, ay move Compa, ex, ey, gocEA + 20 rotate_compa Compa, r, 50 disappear Compa get_point &gx, &gy, dx, dy, angle, r set_paper Paper get_angle &angle, ax, ay, gx, gy get_point &x, &y, ax, ay, angle, 2*r set_paper Paper, 1, 0xFF00FF create_line ax, ay, x, y erase Draft // Vẽ phân giác góc B set_paper Draft appear Compa move Compa, bx, by, 90 call Compa.OpenCompa, rotate_compa Compa, 3, 200 get_angle &angle, bx, by, ax, ay (2) get_point &dx, &dy, bx, by, angle, get_angle &angle, bx, by, cx, cy get_point &ex, &ey, bx, by, angle, move Compa, dx, dy, 90 rotate_compa Compa, 3, 170 move Compa, ex, ey, 90 rotate_compa Compa, 3, 190 disappear Compa get_point &gx, &gy, dx, dy, angle, set_paper Paper get_angle &angle, bx, by, gx, gy get_point &x', &y', bx, by, angle, set_paper Paper, 1, 0xFF00FF create_line bx, by, x', y' // Vẽ đường tròn nội tiếp get_intersection1 &ix,&iy,ax,ay,x,y,bx,by,x',y' appear Pencil, ix, iy appear Point,ix,iy,"I",leftabove disappear Pencil erase Draft get_perpendicular &hx,&hy,ix,iy,ax,ay,bx,by create_line3 hx,hy,ix,iy note_angle 0,"",ix,iy,hx,hy,ax,ay appear Point,hx,hy,"H", rightbelow radius = sqrt((ix-hx)^2+(iy-hy)^2) get_angle &angle, hx, hy, ix, iy appear Compa move Compa, ix, iy,angle+180 call Compa.OpenCompa, radius set_paper Paper, 2, 0x0000FF rotate_compa Compa, radius, 270 disappear Compa end (3)