ifthenelse
Posted: Tue Aug 22, 2023 2:59 am
I'm not really finding examples on the net and (as usual) I'm finding the PGF/TikZ manual to be less than useful.
I'm trying to determine the quadrant a point is in. Heck, let's get simpler. I want to find out if 1 = 1.
But this doesn't work. And even if it did, where is the result stored? The examples I've found on the net, which are virtual copies of this, don't say how to get the result.
Gah!
I'd like to do something like the following:
\def\px{1}
\def\py{-1}
\ifthenelse{\and{\greater{\px}{0}}{greater{\py}}}{1}{};
\ifthenelse{\and{\greater{0}{\px}}{greater{\py}}}{2}{};
\ifthenelse{\and{\greater{0}{\px}}{greater{0}{\py}}}{3}{};
\ifthenelse{\and{\greater{\px}{0}}{greater{0}{\py}}}{4}{};
to get the result 4.
Thanks!
-Dan
I'm trying to determine the quadrant a point is in. Heck, let's get simpler. I want to find out if 1 = 1.
Code: Select all
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\ifthenelse{\equal{1}{1}}{true}{false};
\end{tikzpicture}
\end{document}
Gah!
I'd like to do something like the following:
\def\px{1}
\def\py{-1}
\ifthenelse{\and{\greater{\px}{0}}{greater{\py}}}{1}{};
\ifthenelse{\and{\greater{0}{\px}}{greater{\py}}}{2}{};
\ifthenelse{\and{\greater{0}{\px}}{greater{0}{\py}}}{3}{};
\ifthenelse{\and{\greater{\px}{0}}{greater{0}{\py}}}{4}{};
to get the result 4.
Thanks!
-Dan