TikZ is “only” a frontend to PGF.
Without PGF there's no TikZ.
PGFMath is used by both PGF and TikZ to parse arbitrary input but can also be used without PGF and TikZ.
Technically, PGFMath has nothing to do with PGF
(which stands for Portable Graphics Format)
but since it was developed with PGF,
it somehow inherited its prefix.
The examples might start with \pgfmathsetmacro\myValue{<eval>}
because that's one way to define a macro \myValue with the evaluation of <eval>.
But \newcommand*\myValue{<eval>} could have also been used,
especially if <eval> is just a number or a length.
PGF commands start with \pgf…,
except for those that start with \pgfmath,
those are macros that can also be used when only PGFMath is loaded but also outside of a pgfpicture or a tikzpicture.
(Some exceptions like \pgfmathanglebetweenpoints exist.)
The PGF/TikZ manual (which is just named pgfmanual.pdf to confuse you a bit more) has its own sections about
- the Design Principles of TikZ and
- the Design Principles of PGF:
- All commands and environments start with
pgf.
- All commands that specify a point (a coordinate) start with
\pgfpoint.
- All commands that extend the current path start with
\pgfpath.
- All commands that set/change a graphics parameter start with
\pgfset.
- All commands that use a previously declared object (like a path, image or shading) start with
\pgfuse.
- All commands having to do with coordinate transformations start with
\pgftransform.
- All commands having to do with arrow tips start with
\pgfarrows.
- All commands for “quickly” extending or drawing a path start with
\pgfpathq or \pgfusepathq.
- All commands having to do with matrices start with
\pgfmatrix.
Notes:
A tikzpicture internally creates a pgfpicture.
The commands of TikZ are
\path (and its derivatives \draw, \fill, \filldraw, \shade, \shadedraw, \clip, \graph, \useasboundingbox, \node, \coordinate, \matrix, \pic),
- the environment
scope and its \scoped command version,
- some like
\datavisualization or \spy that are only available via a library and, of course,
\tikzset to set options via the key-value syntax outside optional [] parameter of the mentioned commands (and \tikzgraphset and \tikzdatavisualizationset).
The \tikz macro provides a shortcut for a tikzpicture.
In TikZ coordinates are enclosed in ( and ).
In TikZ path operations are --, |-, rectangle, .. controls … .. and similar (but also to and edge which are special again).
Graphics parameters are usually set via the key-value syntax (like colors and dash patterns).
These is done by TikZ in the ; at the end of the line in combination with the keys draw, fill and so on.
Transformations are also done via the key-value syntax (scale, shift, …).
Arrows are specified via – you guessed it – the key-value syntax. Explicitily via the arrows key but TikZ has set up its PGFKeys namespace so that keys with a - are interpreted as an arrow tip specification.
These quick commands are not available on the TikZ level.
Besides \matrix most matrix settings are done via the key-value syntax again. (Though, the TeX counts \pgfmatrixcurrentrow and \pgfmatrixcurrentcolumn can often times be seen in a TikZ matrix.)
Speaking of PGFKeys, similar to PGFMath this is just another package that can be used standalone without PGF and TikZ. PGFKeys does not draw anything.
\pgfmathsetmacro\myValue{<eval>}because that's one way to define a macro\myValuewith the evaluation of<eval>. But\newcommand*\myValue{<eval>}could have also been used, especially ifevalis just a number or length. – Qrrbrbirlbel Oct 21 '22 at 21:41\pgf, except for thos that start with\pgfmath, those are macros that can be used with PGFMath only. (Some exceptions exist.) – Qrrbrbirlbel Oct 21 '22 at 21:45