\documentclass[border=0pt,multi=my,crop]{standalone}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% https://tex.stackexchange.com/questions/51757/how-can-i-use-tikz-to-make-standalone-svg-graphics
% cd path_to_directory_containing_filename.tex
% dvisvgm --no-fonts filename.dvi
% The default tikz line width is 0.5pt, which is 0.0176389cm (noting that 1pt = 0.0352778cm).
% So setting the tikz line width to 0.02cm approximates the default
% The use of cm in tikz is to allow for coordinate alignment with JSXGraph (by default 1 tikz cm = 1 JSXGraph unit)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amssymb, amsmath}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{xcolor}
\usepackage{pgf,pgfplots,tikz}
\usetikzlibrary{calc,shapes,positioning,fit,decorations,decorations.text,decorations.pathmorphing,backgrounds,patterns,arrows,arrows.meta,quotes,angles}
\usepackage{ifthen}
\usepackage{tkz-euclide}
\usetkzobj{all} % Remove if you use TexLive2020

\newwrite\myoutput
\immediate\openout\myoutput=\jobname.output

\def\shoutmyn#1{\expandafter\show\csname tikz@cc@n@#1\endcsname}

\makeatletter
% Thanks to Paul Gaborit https://tex.stackexchange.com/a/179946/38080
\def\extractcoord#1#2#3{
  \path let \p1=(#3) in \pgfextra{
    \pgfmathsetmacro#1{\x{1}/\pgf@xx}
    \pgfmathsetmacro#2{\y{1}/\pgf@yy}
    \xdef#1{#1} \xdef#2{#2}
  };
}
\makeatother

\makeatletter
\def\extractcoordB#1#2#3#4#5{
  \path let \p1=(#3) in \pgfextra{
    \pgfmathsetmacro#1{\x{1}/\pgf@xx}
    \pgfmathsetmacro#2{\y{1}/\pgf@yy}
		\pgfmathsetmacro\xdist{#1-#4}
		\pgfmathsetmacro\ydist{#2-#5}
    \xdef#1{\xdist} \xdef#2{\ydist}
  };
}
\makeatother

\newcommand{\showboundingbox}{
    \extractcoord\xa\ya{current bounding box.south west}
    \extractcoord\xb\yb{current bounding box.north east}
		\extractcoordB\xatoxb\yatoyb{current bounding box.north east}\xa\ya
		\write\myoutput{[\xa,\ya],[\xatoxb,\yatoyb]}	
}

\tikzset{every picture/.style={line width=0.02cm}}

\begin{document}

\pagestyle{empty}

\begin{my}
\begin{tikzpicture}[tight background,background rectangle/.style={draw=none,fill=white!0}]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Insert tikzpicture code here (not including the \begin{tikzpicture} or \end{tikzpicture} lines



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\showboundingbox		
\end{tikzpicture}
\end{my}

\end{document}
