# Tikz curve without control points

Is there a way in Tikz to draw a smooth curve that passes through some specified points without the need of specifying control points, like you can do in Asymptote?

For example, in Asymptote I can do

``````draw((0,0)..(100,0)..(100,100)..(0,100)..cycle);
``````

to obtain a curve that looks like a circle.

What's the Tikz analogous for plain TeX?

• Yes it's the `hobby` package. – percusse Jan 21 '16 at 11:02
• @percusse In the package documentation I see that `hobby` is written using LaTeX3. I am running Tikz on top of plain TeX, so I can't use `hobby` – User Jan 21 '16 at 11:07
• Then no there is none. Any reason to stick to plain? – percusse Jan 21 '16 at 11:08
• @percusse I am not really using plain TeX, but OPmac, which is a set of macros built upon plain TeX. The reason is that I like more OPmac than LaTeX – User Jan 21 '16 at 11:14
• Ah then you need to ask @wipet – percusse Jan 21 '16 at 11:14

For this case perhaps `plot coordinates` with `smooth cycle,tension=1` is useful. I borrowed and modified daleif's code.

``````\input tikz.tex
\baselineskip=12pt
\hsize=6.3truein
\vsize=8.7truein
We are working on
\tikzpicture[x=0.5mm,y=0.5mm]
\draw [smooth cycle,tension=1] plot coordinates {(0,0)(100,0)(100,100)(0,100)};
\endtikzpicture.
\bye
``````
• I try it a bit and then let you know if this works as I want – User Jan 21 '16 at 12:01
• – Chris Chudzicki Jan 21 '16 at 12:29
• @User See mrc's comment above, perhaps of interest. – Torbjørn T. Jan 21 '16 at 13:32
• It seems to work right :) – User Jan 21 '16 at 13:36
• Also: the question tex.stackexchange.com/q/54771/484 contains an example showing the difference between `plot[smooth]` and the Hobby algorithm used in Metapost and Asymptote. Basically, `plot[smooth]` uses a simpler algorithm that gives less good results, although it's fine for a circle. – Charles Staats Jan 22 '16 at 16:59

Page 30 in the tikz/pgf manual?

``````\input tikz.tex
\baselineskip=12pt
\hsize=6.3truein
\vsize=8.7truein
We are working on
\tikzpicture[x=1mm,y=1mm]
\draw (0,0) to (100,0) to (100,100) to (0,100) to cycle;

\endtikzpicture.
\bye
``````

the default unit in tikz is cm, so `(100,100)` was a little large.

• Doesn't this produce a square instead of something that looks like a circle? – User Jan 21 '16 at 11:26
• @User `\draw (0,0) to[out=90,in=180] (50,50) to[out=0,in=90] (100,0) to[out=270,in=0] (50,-50) to[out=180,in=270] cycle;` – Torbjørn T. Jan 21 '16 at 11:34
• @TorbjørnT. This is not what I was looking for because you have to specify in and out directions, but it could be a good compromise :) – User Jan 21 '16 at 11:40
• @User I do not ue asymptote, so I do know know its details – daleif Jan 21 '16 at 11:42