diff --git a/rowan/functions.py b/rowan/functions.py
index 2f6a0c4..8a960dc 100644
--- a/rowan/functions.py
+++ b/rowan/functions.py
@@ -1031,8 +1031,8 @@ def to_axis_angle(q):
     sines = np.sin(angles/2)
     # Avoid divide by zero issues; these values will not be used
     sines[sines == 0] = 1
-    axes = np.where(angles != 0,
-                    q[..., 1:]/sines,
+    axes = np.where(angles[..., np.newaxis] != 0,
+                    q[..., 1:]/sines[..., np.newaxis],
                     0)
 
     return axes, angles

to_axis_angle not working for multiple quaternions?
I have several quaternions and want to get axes/angles. This is a traceback of what happens. I'm using rowan v1.2.0.
```
>>> rowan.to_axis_angle(rowan.normalize([[0.707, 0, 0, 0.707], [0, 0, 0, 1]]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/bdice/anaconda3/envs/dice/lib/python3.6/site-packages/rowan/functions.py", line 1035, in to_axis_angle
    q[..., 1:]/sines,
ValueError: operands could not be broadcast together with shapes (2,3) (2,)
```
diff --git a/tests/test_axis_angle.py b/tests/test_axis_angle.py
index 3387061..b81cfa0 100644
--- a/tests/test_axis_angle.py
+++ b/tests/test_axis_angle.py
@@ -85,8 +85,19 @@ class TestFromAxisAngle(unittest.TestCase):
 class TestToAxisAngle(unittest.TestCase):
     """Test converting to axis angle representation"""
 
+    def test_div_zero(self):
+        q = (1, 0, 0, 0)
+        axes, angles = rowan.to_axis_angle(q)
+        self.assertTrue(np.allclose(axes, [0, 0, 0]))
+        self.assertEqual(angles, 0)
+
     def test_to_axis_angle(self):
-        axes, angles = rowan.to_axis_angle(
-            np.array((np.sqrt(2)/2, np.sqrt(2)/2, 0, 0)))
+        q = (np.sqrt(2)/2, np.sqrt(2)/2, 0, 0)
+        axes, angles = rowan.to_axis_angle(q)
         self.assertTrue(np.allclose(axes, np.array([1, 0, 0])))
         self.assertTrue(np.allclose(angles, np.pi/2))
+
+        q2 = np.stack((q, q), axis=0)
+        axes, angles = rowan.to_axis_angle(q2)
+        self.assertTrue(np.allclose(axes, np.array([[1, 0, 0], [1, 0, 0]])))
+        self.assertTrue(np.allclose(angles, [np.pi/2, np.pi/2]))

pip install -e .
parse_log_pytest
requirements.txt
coverage pytest
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
coverage==6.2
importlib-metadata==4.8.3
iniconfig==1.1.1
numpy==1.19.5
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
-e git+https://github.com/glotzerlab/rowan.git@a6b947397e1de6797cfac144b0fa9e410c75c683#egg=rowan
tomli==1.2.3
typing_extensions==4.1.1
zipp==3.6.0

name: rowan
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - coverage==6.2
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - numpy==1.19.5
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - zipp==3.6.0
prefix: /opt/conda/envs/rowan

tests/test_axis_angle.py::TestToAxisAngle::test_to_axis_angle
tests/test_axis_angle.py::TestFromAxisAngle::test_complex tests/test_axis_angle.py::TestFromAxisAngle::test_multiple tests/test_axis_angle.py::TestFromAxisAngle::test_multiple_vectors tests/test_axis_angle.py::TestFromAxisAngle::test_single tests/test_axis_angle.py::TestToAxisAngle::test_div_zero
rowan/functions.py
rowan/functions.py