Possibly something like this? It may not be maximally efficient as I started from the code in the question and something which plots each one might provide greater elegance.
\documentclass[border=10pt,multi,tikz]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[>=Stealth]
\foreach \i in {0,...,3}{
\begin{scope}[xshift=\i*4.5cm]
\draw [<->] (-1.2,0)--(2.5,0);
\draw [<->] (0,-1.2)--(0,1.7);
\draw[shorten <=-1cm, shorten >=-3mm] (0,1)--(2,0) node [midway, above] {$A$};
\end{scope}
}
\begin{scope}[draw=blue, densely dashed]
\draw [] (-1,0)--(0,1)--(1,0)--(0,-1)--cycle;
\draw [](4.5,0) circle (0.88cm);
\draw [xshift=9cm] (-.66,-.66) rectangle (.66,.66);
\begin{scope}[xshift=13.5cm]
\draw [domain=0:90,samples=100,smooth,variable=\t] plot({-1*cos(\t)^(3)},{1*sin(\t)^(3)});
\draw [domain=0:90,samples=100,smooth,variable=\t] plot({-1*cos(\t)^(3)},{-1*sin(\t)^(3)});
\draw [domain=0:90,samples=100,smooth,variable=\t] plot({1*cos(\t)^(3)},{-1*sin(\t)^(3)});
\draw [domain=0:90,samples=100,smooth,variable=\t] plot({1*cos(\t)^(3)},{1*sin(\t)^(3)});
\end{scope}
\foreach \i [count=\j from 0] in {(0,1),(.39,.79),(.66,.66),(0,1)} \scoped [xshift=\j*4.5cm] { \draw [{Circle[width=3pt, length=3pt, fill=black, black]}-{Circle[width=3pt, length=3pt, fill=black, black]}, shorten <=-1.5pt, shorten >=-1.5pt] (0,0) node [below left] {$x$} -- \i node [above right] {$\hat x$} ; };
\end{scope}
\foreach \i [count=\j from 0] in {1,2,\infty,\frac{1}{2}} \scoped [xshift=\j*4.5cm] { \node [anchor=mid west] at (0,-1.5) {$p=\i$}; };
\end{tikzpicture}
\end{document}
Here's a starting point for you. As always, eat the elephant bite by bite ... Repeat for all relevant fragments of the drawing and join into one drawing, in the end.
So first of all it's enough to focus on one halve, say the right one. You can always mirror it later. To better see the various parts I did some coloration.
Next overlay a grid, e.g. via Paint.net
, Gimp
or other programs. We'll need certain points from the drawing to pave the way.
For the grid I used this, so it may be a good time to look up the commands in the pgfmanual and its tutorial part:
\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) grid (5,10);
\end{tikzpicture}
\end{document}
Now, let's try to approximate the golden area. We just need the outlines and don't need to care about precision, overlaps etc. Leave that for later.
Let's try to mimick a very coarse form by approximating the blue and red line. The relevant part is drawing just two pathes:
% ~~~ blue path ~~~~~~~~~~~
\draw (0,6.2) -- (1.1,4.1) -- (1.2,2.7) -- (1.7,2.7) -- (1.5,1.9);
% ~~~ red path ~~~~~~~~~~~
\draw (0,6.4) -- (1.2,4.2) -- (2.1,3.9) -- (3.5,4.2) -- (1.8,1.9);
This results in:
To introduce the bends we can specify out- and in-angles, like so: replacing --
by to [out=260,in=95]
. The manual mentions even more ways, e.g. Bezier-like controls. Make your choice.
Final result:
Code, with some minor coordinate moves (compare coarse and fine) :
\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}% ~~~ very coarse ~~~
% ~~~ comment out or delete grid later ~~~
\draw [help lines] (0,0) grid (7,13);
% ~~~ blue path ~~~~~~~~~~~
\draw (0,6.2) -- (1.1,4.1) -- (1.2,2.7) -- (1.7,2.7) -- (1.5,1.9);
% ~~~ red path ~~~~~~~~~~~
\draw (0,6.4) -- (1.2,4.2) -- (2.1,3.9) -- (3.5,4.2) -- (1.8,1.9);
\end{tikzpicture}
\begin{tikzpicture}% ~~~ with bends ~~~
% ~~~ comment out or delete grid later ~~~
\draw [help lines] (0,0) grid (7,13);
% ~~~ blue path ~~~~~~~~~~~
\draw (0,6.2) to [out=260,in=95] (1.1,4.1)
to [out=5,in=55] (1.2,2.7)
to [out=270,in=240](1.8,2.7)
to [out=260,in=220] (1.7,1.9);
% ~~~ red path ~~~~~~~~~~~
\draw (0,6.4) to [out=280,in=85] (1.2,4.2)
to [out=10,in=105] (2.1,3.9)
to [out=50,in=150] (3.5,4.2)
to [out=-200,in=50] (1.8,1.9);
\end{tikzpicture}
\end{document}
P.S.: Outlook, how to continue
Let's assume you know how to draw (most) parts of your ornament. How to join everthing?
Let's introduce the \pic
element, so that you can write sth. like this: \pic at (0,0) {halve};
This cleans up your code. You'll obtain it by moving everything to a \tikzset{ }
statement, where you define, what halve
means in this file:
\begin{document}
\tikzset{% ~~~ all drawings needed for one halve ~~~~~~~~~
halve/.pic={
% ~~~ blue path ~~~~~~~~~~~
\draw (0,6.2) to [out=260,in=95] (1.1,4.1)
...
\draw (0,13) to [bend right] (1,12) -- (0,11);
}
}
To make things easier to see, I included 3 more dummy-shapes, see the final code below. BTW, this is how you obtain closed pathes
using cycle
, which you might need when it comes to overlaps and perhaps using layers just like in graphic programs:
% ~~~ rightmost; example for closed path ~~~~
\draw (5.5,3.8) -- (5.5,5.5) -- (6.5,4.8) -- cycle;
Now you can place several halve
s wherever you want, including scaling (which requires transform shape
, too), see final code:
Finally, what's about the whole symmetrical ornament? As you may guess, we'll define just another \pic
, which includes a mirrored halve
:
\tikzset{% ~~~ putting two halves together ~~~~~~
ornmnt/.pic={
\pic at (0,0) {halve};
\pic [xscale=-1] at (0,0) {halve};
}
}
Final code for all of this:
\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tikz}
\begin{document}
\tikzset{% ~~~ all drawings needed for one halve ~~~~~~~~~
halve/.pic={
% ~~~ blue path ~~~~~~~~~~~
\draw (0,6.2) to [out=260,in=95] (1.1,4.1)
to [out=5,in=55] (1.2,2.7)
to [out=270,in=240](1.8,2.7)
to [out=260,in=220] (1.7,1.9);
% ~~~ red path ~~~~~~~~~~~
\draw (0,6.4) to [out=280,in=85] (1.2,4.2)
to [out=10,in=105] (2.1,3.9)
to [out=50,in=150] (3.5,4.2)
to [out=-200,in=50] (1.8,1.9);
% ~~~ simple pattern at origin ~~~~~
\draw (0,0) to [bend left] (1,1);
% ~~~ rightmost; example for closed path ~~~~
\draw (5.5,3.8) -- (5.5,5.5) -- (6.5,4.8) -- cycle;
% ~~~ top ornament ~~~~~~~~~~~~~~~~~
\draw (0,13) to [bend right] (1,12) -- (0,11);
}
}
\tikzset{% ~~~ putting two halves together ~~~~~~
ornmnt/.pic={
\pic at (0,0) {halve};
\pic [xscale=-1] at (0,0) {halve};
}
}
% ~~~ (1) let's see the \pic {halve} ~~~~~~~~~~
\begin{tikzpicture}% ~~~ with bends ~~~
% ~~~ comment out or delete grid later ~~~
\draw [help lines] (0,0) grid (7,13);
\pic at (0,0) {halve};
\node [red] at (5,11.3) {one halve of the ornament};
\end{tikzpicture}
% ~~~ (2) using \pic {halve} ~~~~~~~~~~~~~
\begin{tikzpicture}% ~~~ with bends ~~~
\pic at (0,0) {halve};
\node [red] at (5,10) {one pic};
\draw [dashed,gray] (8,0) -- (8,13);
\pic at (8,0) {halve};
\node [red] at (13,10) {one more pic};
\draw [dashed,gray] (16,0) -- (16,13);
\pic [scale=.5, transform shape] at (16,0) {halve};
\node [red] at (19,10) {smaller pic};
\end{tikzpicture}
% ~~~ (3) let's see the full ornament ~~~~~~~~
\begin{tikzpicture}
\pic at (0,0) {ornmnt};
\end{tikzpicture}
\end{document}
Best Answer
Welcome to TeX.SE!!
Here is a solution. Basically, I use the TikZ 3d library to define a vertical rotated
canvas
inside ascope
. Then, in the scope I draw the rectangles and thearcs
. Of course I need to do this three times, one for each plane. The last thing to draw are the nodes (balls), this way they don't interfere with the visibility.Something like this: