|
This example demonstrates the construction of the circumcircle of a triangle in the xy-plane. The scene is parametrized by the coordinates of the vertices of the triangle; thus, you may drag these vertices to new positions and the circumcircle will be recalculated accordingly. |
Here is how I created this example within Mathematica:
a = {ax, ay, 0}; b = {bx, by, 0}; c = {cx, cy, 0};
independentVariables =
{ax -> 1, ay -> 3, bx -> 4, by -> 2, cx -> 2, cy -> 5};
mab = (a + b)/2; mbc = (b + c)/2; mac = (a + c)/2; o = {ox, oy, 0};
orthogonal[{x_, y_, 0}] := {-y, x, 0}
sol = ((mab + l1*orthogonal[b - a]) /.
Solve[mab + l1*orthogonal[b - a] == mbc + l2*orthogonal[c - b],
{l1, l2}][[1]])
dependentVariables = {ox -> sol[[1]], oy -> sol[[2]],
r -> Sqrt[(a - o).(a - o)]};
circlePoints = Table[o + r*{Sin[phi], Cos[phi], 0},
{phi, 0, 2. Pi + 0.000001, 2. Pi/100.}];
scene = Graphics3D[{{Thickness[0.015], Line[{a, b, c, a}]},
Line[{mab, o}], Line[{mbc, o}], Line[{mac, o}],
PointSize[0.05], Point[a], Point[b], Point[c],
PointSize[0.02], Point[o], Line[circlePoints]},
Boxed -> False, ViewPoint -> {0, 0, 3}, ViewVertical -> {0, 1, 0}];
Show[scene //. dependentVariables /. independentVariables];
Then the InputForm of the scene and the replacement rules were pasted into this HTML page.