Studio TikZ

Open Studio TikZ Examples and LaTeX code Download the offline editor

Comments and feature requests

When I prepare an olympiad handout, I usually move points around in GeoGebra until the diagram reads well, take the coordinates and type the TikZ by hand. GeoGebra provides its own TikZ export. I kept rewriting it because I have my own conventions for naming points, placing labels, colouring circles and marking angles.

I made Studio TikZ to see a construction alongside the code that goes into my handout. Draw a segment $AB$, select it and watch the corresponding line of code. Change the line to dashed and compare the two versions. I hope these small experiments make my TikZ style easier to learn.

With Point, click a blank spot to create a free point, or click segment $AB$ to place $P$ on it. Switch to Select / move and drag $P$ along $AB$. When you move $B$, the point follows the segment. Try the Point animation.

To place a point at exactly $(2,0)$, I check Show grid, which also turns on Snap to grid. At 100% zoom, Grid spacing reads $1$ unit. I choose Point, move the pointer over blank space, and click when the marker reads $(2,0)$. With Polygon, I can place the first vertex there too, then click in the middle of a square for an off-grid second vertex. Snapping takes effect only near a grid intersection. To move a point, choose Select / move and drag the dot. Dragging the letter moves its label. Grid and coordinates.

Choose + Add sheet for a blank tab with the lowest available sheet number, or select several files with Open file. Each drawing has its own tab. In the Sheet menu, choose Example sheets to explore a construction or Wildan’s worked examples for olympiad diagrams. To return from an example, click the personal tab you want, or choose My sheets → My drawing for the last personal tab you used.

Choose the side-by-side layout to inspect the code while drawing, or stack the panels for a wider canvas. The browser remembers the layout and your Indonesian or English language preference. Focus the canvas before pressing + or − to zoom. The canvas zoom percentage and the printed TikZ scale can be adjusted independently.

Studio TikZ examples

Here are three diagrams I use when teaching olympiad geometry. Read the TikZ alongside each figure, or open the construction in Studio and drag its points.

LaTeX packages

Place these two lines before \begin{document}. The dvipsnames option supplies the named colours used in these diagrams.

\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}

Examples 1 and 3 use \usetikzlibrary{angles} for the angle arcs. The line is included in each code sample.

1. A reflection and two cyclic quadrilaterals

Let $M$ lie on $\overline{AC}$ in triangle $ABC$. Reflect $M$ across $BC$ to obtain $N$. Line $AN$ meets $\overline{BC}$ at $O$, and $A,B,M,O$ are concyclic. If $\angle ABN=56^\circ$, find $\angle CMN$.

Two circles through A and B, a blue 56-degree angle at B, and a dashed red reflection segment MN.
The solid green circle passes through $A,B,M,O$, and the dotted blue circle passes through $A,B,C,N$. The blue arc at $B$ marks $56^\circ$. The dashed segment $MN$ and the arc at $M$ are brick red.

TikZ code

\usetikzlibrary{angles}
\begin{center}
\begin{tikzpicture}[scale=1, font=\small]
    \coordinate (A) at (0, 0);
    \path (A) ++(-0.36, -0.29) node[inner sep=0pt] {$A$};
    \coordinate (B) at (1, 5);
    \path (B) ++(-0.055, 0.32) node[inner sep=0pt] {$B$};
    \coordinate (M) at (2, 0);
    \path (M) ++(0.025, -0.35) node[inner sep=0pt] {$M$};
    \coordinate (C) at (3.65855, 0);
    \path (C) ++(0.33, -0.25) node[inner sep=0pt] {$C$};
    \coordinate (N) at (4.58599, 1.375);
    \path (N) ++(0.32, 0.05) node[inner sep=0pt] {$N$};
    \coordinate (O) at (3.1555, 0.9461);
    \path (O) ++(-0.37, 0.18) node[inner sep=0pt] {$O$};

    \draw[semithick, PineGreen] (1, 2.4) circle (2.6);
    \draw[semithick, MidnightBlue, opacity=0.8, dotted] (1.82927, 2.23415) circle (2.8875);
    \draw[semithick] (A)--(B);
    \draw[semithick] (B)--(C);
    \draw[semithick] (C)--(A);
    \draw[thin] (A)--(N);
    \draw[thin] (B)--(M);
    \draw[thin] (B)--(N);
    \draw[thin] (N)--(C);
    \draw[semithick, BrickRed, dashed] (M)--(N);
    \draw[thick] (M)--(O);
    \pic[draw=MidnightBlue, thick, angle radius=0.39cm] {angle=A--B--N};
    \node[inner sep=0pt, text=MidnightBlue] at (0.49, 4.38) {$56^{\circ}$};
    \pic[draw=BrickRed, thick, angle radius=0.39cm] {angle=C--M--N};

    % Keep printed point radius at 1.5pt when scale changes.
    \pgfgettransformentries{\studioXX}{\studioYX}{\studioXY}{\studioYY}{\studioDX}{\studioDY}
    \pgfmathsetlengthmacro{\studioRadiusTitik}{1.5pt/veclen(\studioXX,\studioYX)}
    \foreach \s in {A,B,M,C,N,O}
        \filldraw (\s) circle (\studioRadiusTitik);
\end{tikzpicture}
\end{center}

Drag the points in example 1 in Studio

2. Three circles on the medians

Let $G$ be the centroid of triangle $ABC$. Let $D,E,F$ be the midpoints of $BC,CA,AB$, respectively, and $D_1,E_1,F_1$ the midpoints of $AG,BG,CG$. Prove that the circumcircles of $D_1EF$, $DE_1F$ and $DEF_1$ have a common point.

The three medians of ABC and three circles through H near AB.
The circumcircle of $D_1EF$ is blue, that of $DE_1F$ is green, and the dashed red circle passes through $D,E,F_1$. Their common point is marked $H$.

TikZ code

\begin{center}
\begin{tikzpicture}[scale=1, font=\small]
    \coordinate (A) at (0, 0);
    \path (A) ++(-0.008, -0.3) node[inner sep=0pt] {$A$};
    \coordinate (B) at (9, 0);
    \path (B) ++(0.06, -0.303) node[inner sep=0pt] {$B$};
    \coordinate (C) at (7.24, 8.24);
    \path (C) ++(0.008, 0.33) node[inner sep=0pt] {$C$};
    \coordinate (D) at (8.12, 4.12);
    \path (D) ++(0.287, 0.04) node[inner sep=0pt] {$D$};
    \coordinate (E) at (3.62, 4.12);
    \path (E) ++(-0.223, 0.215) node[inner sep=0pt] {$E$};
    \coordinate (F) at (4.5, 0);
    \path (F) ++(-0.009, -0.3) node[inner sep=0pt] {$F$};
    \coordinate (G) at (5.41333, 2.74667);
    \path (G) ++(0.123, -0.495) node[inner sep=0pt] {$G$};
    \coordinate (D1) at (2.70667, 1.37333);
    \path (D1) ++(-0.184, -0.454) node[inner sep=0pt] {$D_{1}$};
    \coordinate (E1) at (7.20667, 1.37333);
    \path (E1) ++(0.266, -0.658) node[inner sep=0pt] {$E_{1}$};
    \coordinate (F1) at (6.32667, 5.49333);
    \path (F1) ++(0.415, 0.221) node[inner sep=0pt] {$F_{1}$};
    \coordinate (H) at (6.28748, 0.5786);
    \path (H) ++(0.116, -0.287) node[inner sep=0pt] {$H$};

    \draw[semithick, MidnightBlue] (4.77139, 2.21195) circle (2.22853);
    \draw[semithick, PineGreen] (4.22861, 3.8888) circle (3.89825);
    \draw[semithick, BrickRed, dashed] (5.87, 3.03945) circle (2.49601);
    \draw[thick] (A)--(B);
    \draw[thick] (B)--(C);
    \draw[thick] (C)--(A);
    \draw[thick] (A)--(D);
    \draw[thick] (B)--(E);
    \draw[thick] (C)--(F);
    \draw[thin] (D)--(E);
    \draw[thin] (E)--(H);
    \draw[thin] (H)--(D);
    \draw[thick] (D1)--(H);
    \draw[thick] (H)--(F);

    % Keep printed point radius at 1.5pt when scale changes.
    \pgfgettransformentries{\studioXX}{\studioYX}{\studioXY}{\studioYY}{\studioDX}{\studioDY}
    \pgfmathsetlengthmacro{\studioRadiusTitik}{1.5pt/veclen(\studioXX,\studioYX)}
    \foreach \s in {A,B,C,D,E,F,G,D1,E1,F1,H}
        \filldraw (\s) circle (\studioRadiusTitik);
\end{tikzpicture}
\end{center}

Drag the points in example 2 in Studio

3. A tangent and two medians

Let $\ell$ be the tangent at $C$ to the circumcircle of a non-isosceles triangle $ABC$. Let $D$ and $E$ be the midpoints of $BC$ and $CA$. Lines $AD$ and $BE$ meet $\ell$ at $A_1$ and $B_1$. Line $AB_1$ meets the circumcircle again at $X$, and $BA_1$ meets it again at $Y$. Prove that $X,Y,D,E$ are concyclic.

A blue-shaded triangle, a red tangent at C, two green circles, and three purple angle marks.
A blue fill at 14% opacity marks triangle $ABC$. The brick-red line is tangent to the blue circumcircle at $C$. The two auxiliary circles are green. Purple arcs mark the three angles being compared.

TikZ code

\usetikzlibrary{angles}
\begin{center}
\begin{tikzpicture}[scale=0.8, font=\small]
    \fill[fill=MidnightBlue, fill opacity=0.14] (0, 0)--(0, 5)--(-6, 4)--cycle;
    \coordinate (A) at (0, 0);
    \path (A) ++(0.09, -0.512) node[inner sep=0pt] {$A$};
    \coordinate (B) at (0, 5);
    \path (B) ++(0.368, 0.368) node[inner sep=0pt] {$B$};
    \coordinate (C) at (-6, 4);
    \path (C) ++(-0.52, 0) node[inner sep=0pt] {$C$};
    \coordinate (D) at (-3, 4.5);
    \path (D) ++(-0.373, -0.444) node[inner sep=0pt] {$D$};
    \coordinate (E) at (-3, 2);
    \path (E) ++(0.168, -0.628) node[inner sep=0pt] {$E$};
    \coordinate (A1) at (-4.65672, 6.98507);
    \path (A1) ++(-0.502, 0.135) node[inner sep=0pt] {$A_{1}$};
    \coordinate (B1) at (-10.09091, -5.09091);
    \path (B1) ++(-0.52, 0) node[inner sep=0pt] {$B_{1}$};
    \coordinate (T) at (-3, 10.66667);
    \path (T) ++(0, 0.52) node[inner sep=0pt] {$T$};
    \coordinate (P) at (-3.94872, 5.92308);
    \path (P) ++(-0.715, 0.04) node[inner sep=0pt] {$P$};
    \coordinate (Q) at (-5.16667, -0.16667);
    \path (Q) ++(0.051, -0.578) node[inner sep=0pt] {$Q$};
    \coordinate (X) at (-2.24054, -1.13036);
    \path (X) ++(0, -0.52) node[inner sep=0pt] {$X$};
    \coordinate (Y) at (-2.70955, 6.15503);
    \path (Y) ++(0.368, 0.368) node[inner sep=0pt] {$Y$};

    \draw[thick, MidnightBlue] (-2.66667, 2.5) circle (3.65529);
    \draw[thick, PineGreen, dotted] (-6.41667, 3.25) circle (3.63815);
    \draw[thick, PineGreen] (-4.33333, 3.25) circle (1.82764);
    \draw[thick] (A)--(B);
    \draw[thick] (B)--(C);
    \draw[thick] (C)--(A);
    \draw[thick] (A)--(A1);
    \draw[thick] (B)--(B1);
    \draw[thick, BrickRed] (B1)--(T);
    \draw[thin, dashed] (X)--(T);
    \draw[thin, dashed] (T)--(Q);
    \draw[thick] (E)--(T);
    \draw[thick] (B1)--(A);
    \draw[thick] (B)--(A1);
    \draw[thin, opacity=0.45] (Q)--(P);
    \pic[draw=RoyalPurple, semithick, angle radius=0.39cm] {angle=E--Q--P};
    \pic[draw=RoyalPurple, semithick, angle radius=0.39cm] {angle=E--D--A};
    \pic[draw=RoyalPurple, semithick, angle radius=0.39cm] {angle=B--A--D};

    % Keep printed point radius at 1.5pt when scale changes.
    \pgfgettransformentries{\studioXX}{\studioYX}{\studioXY}{\studioYY}{\studioDX}{\studioDY}
    \pgfmathsetlengthmacro{\studioRadiusTitik}{1.5pt/veclen(\studioXX,\studioYX)}
    \foreach \s in {A,B,C,D,E,A1,B1,T,P,Q,X,Y}
        \filldraw (\s) circle (\studioRadiusTitik);
\end{tikzpicture}
\end{center}

Drag the points in example 3 in Studio

Read the construction steps for all three diagrams

Construction and presentation

Choose Polygon and click the vertices in order. For triangle $ABC$, click $A$, $B$ and $C$, then click $A$ again or press Enter to close it. For a quadrilateral, add $D$ before closing. Click inside the finished shape to select or fill it. Try the Polygon animation.

In the Lines menu, select Perpendicular bisector, then click the segment or its two endpoints. Drag $A$ and check that the line still passes through the midpoint. To bisect $\angle ABC$, choose Internal angle bisector or External angle bisector in Lines, then click $A$, $B$ and $C$, or click an existing angle mark.

For translation, rotation, reflection, dilation or inversion of an entire shape, select the tool and click inside the shape. The source-object list helps when objects overlap. For reflection, click the mirror point or line next. For Transformations → Inversion, click the source object and then the circumference of the reference circle. Try choosing a circle through the inversion centre as the source to see it map to a line. A pentagon maps edge by edge, and you can select its image for another transformation.

In Sheet → Example sheets, open Transforming a shape and drag $A$ on the green pentagon. Its reflection is the blue point $A^{\prime}$ and its inverse is the orange point $A^{\ast}$. The other vertices follow the same pattern through $E^{\prime}$ and $E^{\ast}$. The interactive inversion lesson follows one triangle closely. Its vertices $A$ and $B$ initially lie on the reference circle. Segment $AB$ maps to the semicircle from $A$ to $B$ through $M^{\ast}$, the image of its midpoint $M$. Drag the inversion centre $O$ and follow $M^{\ast}$ along the image arc. You can also enter a name such as A* in the Name field to label a point $A^{\ast}$.

Use Label on the top toolbar to add a free annotation. In a crowded diagram, select a point label, angle label or free label and switch on its translucent background. Lower the background opacity if a nearby line needs to remain prominent. Choose Angle beside Label on the top toolbar and click $A$, $B$ and $C$ to mark the angle at $B$. At $90^\circ$ the arc becomes a square mark. Move a point so the angle changes and the arc returns. The square has its own size control. Select several objects using Ctrl+click (or ⌘+click) to change their colour or hide them together. Name and save the group to select the same objects again later. The same palette is available for outlines and fills.

Choose Clip drawing by the zoom controls to keep part of a diagram for a handout. Click opposite corners for a rectangle, or select a circle, sector or polygon as the boundary. The crop applies to the canvas and to the complete TikZ drawing, including its labels. Try the clipping guide.

Try a construction

In triangle $ABC$, place $D$ on $AB$ so that $AD=2\cdot DB$. Use the vector formula tool and enter D = (A + 2B)/3. Drag $B$ and observe how both the diagram and the coordinates change. The relevant line in the TikZ export is

\coordinate[label={[text=PineGreen]below:$D$}] (D) at (${1/3}*(A) + {2/3}*(B)$);
Play the construction animationDrawing triangle ABC and defining D using a vector formula.

Drag $A$, $B$ or $C$ above. The point $D$ stays two-thirds of the way from $A$ to $B$. Open the antiparallel-line animation for another example, then drag $D$ or segment $DE$ in the interactive construction.

Taking the diagram to LaTeX or AoPS

Copy the preamble from the code panel before pasting the figure into your document. Load xcolor with its dvipsnames option before TikZ. Studio adds the TikZ libraries used by the current figure, such as angles and calc. The examples above include the code for inspection.

For an AoPS diagram, open Paste Asymptote, paste the [asy] block and choose Convert to TikZ. For a diagram Studio can read directly, choose Open in new sheet. Use Select / move to drag the endpoint of a segment. The code panel updates as the endpoint moves, so you can copy the TikZ as soon as the segment looks right. Your other sheets stay open. Open the Asymptote converter.

The original Asymptote stays in the converter. To change the number of squares in Nested squares, for example, change n = 25 to n = 5 and convert again. In the Studio sheet you can drag points in the drawing the loop produced.

The converter supports constructions such as line–circle intersections, helper functions, opacity and clipping.

Try one of these problems from AoPS Contests. Open the thread and click the diagram in the first post. In the Asymptote code below window, select the text from [asy] through [/asy], copy it, and paste it into Paste Asymptote.

For a diagram using a custom module or a 3D projection, open Convert an SVG rendered by Asymptote to bring the locally rendered paths into TikZ. In the other direction, the AoPS export wraps TikZ in a single Asymptote label. Pasting that wrapper into the converter recovers its original TikZ. Read the conversion steps.

Strengths and limits

Strengths

  • Learn the TikZ while drawing. When I select a segment, Studio highlights the command that draws it. I can copy the complete figure in the style I use for handouts, or take just the coordinates and write my own lines and labels.
  • Explore different positions in one construction. Drag a triangle vertex and watch its incircle, angle bisector or inverse image move. The tool animations show where to click, and the interactive examples let readers move the points themselves.
  • Prepare the diagram for print. I can reposition LaTeX labels, use translucent fills and choose angle marks. Changing the TikZ scale keeps the printed point radius at $1.5\,\mathrm{pt}$.
  • Reuse an AoPS diagram. When Studio can open an Asymptote diagram on the canvas, I can reposition its points and copy TikZ that follows the drawing automatically. If I only need to change one command, I can also edit TikZ code directly in the converter.
  • Keep several drawings open, including offline. I can name a tab for each problem and switch between them during class. The downloaded HTML includes the drawing tools, interactive examples and guide animations.

Limitations

  • Autosave keeps sheets in the current browser. Save sheet downloads the displayed drawing as one .stikz.json file. Delete sheet asks for confirmation before removing the selected tab. When one sheet remains, use Clear drawing to start over in that tab. Use Open file to reopen a downloaded copy in a new tab alongside your other drawings.
  • The drawing tools focus on olympiad geometry. Studio has no general tool for plotting functions or drawing conics from their equations. To plot a parabola such as $y=x^2$, I still use GeoGebra.
  • GeoGebra import covers some 2D objects. Studio may read a point’s stored coordinates from a .ggb file even when its construction dependencies do not carry over. Saving a Studio drawing as .stikz.json preserves its construction.
  • Asymptote import recovers only some construction relationships. A drawing can look exactly like the original and still behave differently when you drag a point. For example, a GeoGebra export may record only the center and radius of a circle through $D,E,F,K$. If you select $D,E,K$ as its defining points, the circle will follow those three. The original coordinates alone cannot tell Studio how $F$ should move to stay on the circle. See the point selection example.
  • Pasting Asymptote can give an error. If the block was cut short, copy it again from [asy] through [/asy]. Even a complete block that runs on AoPS can use a command or module Studio does not recognise. If the message gives a line and column, use Go to this line to inspect it. For unsupported features, render with Asymptote on your computer, then import the SVG or include the PDF in LaTeX. SVG and PDF conversion steps.
  • Update the offline copy manually. Download the latest HTML from this project page, then open your saved .stikz.json file in the new editor.

Read the user guide · Follow the three worked diagrams

Comments and feature requests

If you need a construction for a problem or handout, tell me in the comments. I’d also like to hear how you use Studio TikZ. If an imported diagram behaves unexpectedly when you drag a point, a small example or a snippet of Asymptote will help me try it.

Memuat reaksi dan komentar…