Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angle in polar coordinates: lose its accepted value range #1048

Closed
muzimuzhi opened this issue Sep 16, 2021 · 1 comment · Fixed by #1051
Closed

Angle in polar coordinates: lose its accepted value range #1048

muzimuzhi opened this issue Sep 16, 2021 · 1 comment · Fixed by #1051

Comments

@muzimuzhi
Copy link
Member

Version: 3.1.9a

In Sec. 13.2.1 "Canvas, XYZ, and Polar Coordinate Systems", page 138, it reads

\begin{key}{/tikz/cs/angle=\meta{degrees}}
The angle of the coordinate. The angle must always be given in degrees
and should be between $-360$ and $720$.
\end{key}

But according to how coord system canvas polar, \pgfpointpolar and the relied \pgfmath(cos|sin)@ are implemented, the restriction -360 <= <angle> <= 720 seems to be unnecessary.

Moreover, whether realized the documented restriction or not, users may already used out-of-range angles in polar coordinates e.g., in foreach loops.

Example showing that out-of-range angles work

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
  % draw three pairwise parallel line segments without error nor warning
  \draw           (0,0) -- (30:1cm) 
    [yshift=10pt] (0,0) -- (1080+30:1cm)
    [yshift=10pt] (0,0) -- (-720+30:1cm);
\end{tikzpicture}
\end{document}
@hmenke
Copy link
Member

hmenke commented Sep 17, 2021

Interesting, good catch. I didn't even know that there was supposed to be a restriction. Feel free to remove it from the manual.

@hmenke hmenke changed the title Angle in polar coordinates: loose its accepted value range Angle in polar coordinates: lose its accepted value range Sep 17, 2021
3geek14 added a commit to 3geek14/pgf that referenced this issue Sep 19, 2021
Signed-off-by: 3geek14 <nerd.of.pi@gmail.com>
muzimuzhi added a commit that referenced this issue Sep 19, 2021
…lue-range

Remove angle restriction as per Issue #1048.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants