I the end I wrote a transformation matrix and manually transformed the points.
\documentclass[11pt]{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
%%%<
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}%
%%%>
\tikzset{isometricXYZ/.style={x={(-0.866cm,-0.5cm)}, y={(0.866cm,-0.5cm)}, z={(0cm,1cm)}}}
%% document-wide tikz options and styles
\begin{document}
\begin{tikzpicture} [scale=4, isometricXYZ, line join=round,
opacity=.75, text opacity=1.0,%
>=latex,
inner sep=0pt,%
outer sep=2pt,%
]
\def\h{5}
\newcommand{\quadrant}[2]{
\foreach \f in {85,75,...,5}
\foreach \t in {#1}
\draw [dotted, fill=#2]
({sin(\f - \h)*cos(\t - \h)}, {sin(\f - \h)*sin(\t - \h)}, {cos(\f - \h)})
-- ({sin(\f - \h)*cos(\t + \h)}, {sin(\f - \h)*sin(\t + \h)}, {cos(\f - \h)})
-- ({sin(\f + \h)*cos(\t + \h)}, {sin(\f + \h)*sin(\t + \h)}, {cos(\f + \h)})
-- ({sin(\f + \h)*cos(\t - \h)}, {sin(\f + \h)*sin(\t - \h)}, {cos(\f + \h)})
-- cycle;
}
\newcommand{\arrowarc}[6]{
\draw[domain=0:320,smooth,variable=\x,->, dashed] plot
({0.07 * (cos(#2)*cos(#3) * cos(\x) + (cos(#3)*sin(#1)*sin(#2) - cos(#1)*sin(#3)) * sin(\x)) + #4},
{0.07 * (cos(#2)*sin(#3) * cos(\x) + (cos(#1)*cos(#3) + sin(#1)*sin(#2)*sin(#3)) * sin(\x)) + #5},
{0.07 * (-sin(#2) * cos(\x) + cos(#2)*sin(#1)* sin(\x)) + #6});
}
%Quadrants
\quadrant{130,140,...,310}{gray!2}
\quadrant{-50,-40,...,130}{gray!2}
\foreach \f in {20,30,...,90}
\foreach \t in {-40,-20,...,120}
{
%Movement arrows
\def\l{1.15}
\draw [black, ->, thick]
({\l*sin(\f)*cos(\t)},{\l*sin(\f)*sin(\t)},{\l*cos(\f)})
-- ({sin(\f)*cos(\t)},{sin(\f)*sin(\t)},{cos(\f)});
% Circles
\def\l{1.12}
\arrowarc{(\f)}{0}{(\t + 90)}{\l*sin(\f)*cos(\t)}{\l*sin(\f)*sin(\t)}{\l*cos(\f)}
};
\end{tikzpicture}
\end{document}][1]
For using sqrt
use an extra pair of braces
\draw[overlay,name path=circle A] (-2,2) circle ({2*sqrt(2)});
For second, specify the second intersection point also like
\path[name intersections={of= circle A and circle B, by={F,f}}];
Drawing those thin lines is up to you as I don't know which points are to be connected.
If I understand the positioning of 5
properly, you need to do this:
\draw[line width=0.1pt] (F) -- node{5} (f) ;
so that it comes midway between AB1 and AB2.
For that 120 degree query use
\coordinate[label={above:$A$}] (set A) at (alpha.120);
And again, if I understand properly, this should give you the point P
:
\path[line width=0.1pt,name path=ff] (F) -- node{5} (f) ;
\path[line width=0.1pt,name path=gg] (G) -- (g);
\path[name intersections={of= ff and gg, by=P}];
And alas, I am confused reading your question. Here is the possibly incomplete code. It would have been useful if you provided a complete hand drawn diagram.
\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings,backgrounds,patterns}
\usepackage{adjustbox}
\usepackage{mathtools}
\begin{document}
\begin{tikzpicture}
\draw[overlay,name path=circle A] (-2,2) circle ({2*sqrt(2)});
\draw[overlay,name path=circle B] (2,2) circle ({2*sqrt(2)});
\draw[overlay,name path=circle C] (0,-2) circle ({2*sqrt(2)});
\fill[pink!80,fill opacity=0.5,draw=red] (45:2.828) circle (2.828);
\fill[pink!80,fill opacity=0.5,draw=red] (135:2.828) circle (2.828);
\fill[pink!80,fill opacity=0.5,draw=red] (-90:2) circle (2.828);
\path[name intersections={of= circle A and circle B, by={F,f}}];
\path[name intersections={of= circle A and circle C, by={G,g}}];
\path[name intersections={of= circle B and circle C, by={H,h}}];
%This positions a point, called S, halfway between the intersections of circle B and circle C.
\coordinate (S) at ($(G)!0.5!(H)$);
\draw[line width=0.1pt] (G) -- (H);
\draw[line width=0.1pt] (g) -- (h);
\draw[line width=0.1pt] (F) -- (g);
%This positions a point, called T, halfway between the intersections of circle A and circle C.
\coordinate (T) at ($(F)!0.5!(G)$);
\draw[line width=0.1pt] (F) -- (G);
\path[line width=0.1pt,name path=ff] (F) -- node{5} (f) ;
\path[line width=0.1pt,name path=gg] (G) -- (g);
\path[name intersections={of= ff and gg, by=P}];
\node at (P) {2};
\draw[name path=PHH] (P) -- ($(P)!6cm!0:(H)$); Change to `\path`
\path[name intersections={of= PHH and circle A, by=APHH}];
\path (H) -- node{3} (APHH);
%The following command puts the number 5 in the region $A \cap B$ and outside the region $A \cap B \cap C$.
%\coordinate[label={5}] (A.intersect.B) at (0,2);
%These three rays start at P. They are used to position the names of the sets.
%I have to replace (0,0) with (P).
\path[overlay,name path=node A,blue,line width=0.1pt] (0,0) -- (120:6);
\path[overlay,name path=node B,blue,line width=0.1pt] (0,0) -- (60:6);
\path[overlay,name path=node C,blue,line width=0.1pt] (0,0) -- (-90:5);
\path[name intersections={of= node A and circle A, by=alpha}];
\path[name intersections={of= node B and circle B, by=beta}];
\path[name intersections={of= node C and circle C, by=gamma}];
\coordinate[label={above:$A$}] (set A) at (alpha.120);
\coordinate[label={above right:$B$}] (set B) at (beta);
\coordinate[label={below:$C$}] (set C) at (gamma);
%These commands will be deleted. They label various points to more quickly see where the intersections
%F, G, and H are located.
\coordinate[label={above:$F$}] (F) at (F);
\coordinate[label={below left:$G$}] (G) at (G);
\coordinate[label={above right:$H$}] (H) at (H);
\node[outer sep=0pt,circle, fill,inner sep=1pt,label=below right:$S$] (S) at (S) {};
\node[outer sep=0pt,circle, fill,inner sep=1pt,label=above left:$T$] (T) at (T) {};
\end{tikzpicture}
\end{document}
Best Answer
The circles are the wrong size because
\tikzmath
works inpt
but the numbers are returned as just numbers, so\radius
is a bare number which is the desired radius as measured inpt
. Then when you use a coordinate like(\x, \y)
, these are just numbers so are interpreted in the current coordinate axes. With no transformations in place then these arecm
. So your numbers are too big. Using(\x pt, \y pt)
says that the numbers are to be interpreted aspt
.Then there is an issue with the calculations inside the loops. By using
\pgfmathtruncatemacro
you are rounding your answers. Either use\pgfmathsetmacro
, or you can do the calculation via anevaluate
key on the\foreach
.