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

Converting cartesian to polar according to the manual #774

Closed
teepeemm opened this issue Jan 20, 2025 · 3 comments
Closed

Converting cartesian to polar according to the manual #774

teepeemm opened this issue Jan 20, 2025 · 3 comments
Assignees
Labels
bug Something isn't working hotfix A change that will be addressed in a hotfix

Comments

@teepeemm
Copy link

I'm confused by this example from the siunitx manual in section 4.7: \complexnum[complex-mode = polar]{1 + i} has the output $1\angle 0\degree$. In a sample file:

\listfiles
\documentclass{article}
\usepackage{siunitx}
\begin{document}
\complexnum[complex-mode = polar]{1 + i} \\
\complexnum[complex-mode = polar]{1 + 1i}
\end{document}

We have the output:
$1\angle 0\degree$
$1.414 213 562 373 095\angle 45\degree$
Whereas I would expect both to match the second output. Am I overlooking something?

The file versions:

 article.cls    2023/05/17 v1.4n Standard LaTeX document class
  size10.clo    2023/05/17 v1.4n Standard LaTeX file (size option)
 siunitx.sty    2024-02-15 v3.3.12 A comprehensive (SI) units package
translations.sty    2022/02/05 v1.12 internationalization of LaTeX2e packages (CN)
etoolbox.sty    2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
pdftexcmds.sty    2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2019/12/03 v1.5 Providing info/warning/error messages (HO)
   iftex.sty    2022/02/03 v1.0f TeX engine tests
 ltxcmds.sty    2023-12-04 v1.26 LaTeX kernel commands for general use (HO)
 amstext.sty    2021/08/26 v2.01 AMS text
  amsgen.sty    1999/11/30 v2.0 generic functions
   array.sty    2023/10/16 v2.5g Tabular extension package (FMi)
   color.sty    2022/01/06 v1.3d Standard LaTeX Color (DPC)
   color.cfg    2016/01/02 v1.6 sample color configuration
  pdftex.def    2022/09/22 v1.2b Graphics/color driver for pdftex
mathcolor.ltx
l3backend-pdftex.def    2024-03-14 L3 backend support: PDF output (pdfTeX)
translations-basic-dictionary-english.trsl    (english translation file `translations-basic-dictionary')
supp-pdf.mkii
@teepeemm
Copy link
Author

Possibly related: \complexnum[complex-mode=cartesian, complex-angle-unit=radians]{1:3.14159265359} becomes $−1−2.067 615 373 566 167i$, where I would expect $-1$ (or at least something within a rounding error of that).

@josephwright
Copy link
Owner

You have a nearly year-old release: for me your example gives the correct output for both forms for the initial issue.

@josephwright
Copy link
Owner

\complexnum[complex-mode=cartesian, complex-angle-unit=radians]{1:3.14159265359}

This one is an issue: I had not allowed for the exponent part in conversion, so the very small residual from angle conversion is being misinterpreted.

@josephwright josephwright added bug Something isn't working hotfix A change that will be addressed in a hotfix labels Jan 20, 2025
@josephwright josephwright self-assigned this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hotfix A change that will be addressed in a hotfix
Projects
None yet
Development

No branches or pull requests

2 participants