aboutsummaryrefslogtreecommitdiff
path: root/docs/source/operations/conversions/axisswap.rst
blob: ddaad0751a09c995e98875cf7577cacd2fd8fd42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.. _axisswap:

================================================================================
Axis swap
================================================================================

Change the order and sign of 2,3 or 4 axes.

+--------------+---------------------------------------------------------------+
| **Options**                                                                  |
+--------------+---------------------------------------------------------------+
| `+order`     | Ordered comma-separated list of axis, e.g. `+order=2,1,3,4`   |
+--------------+---------------------------------------------------------------+


Each of the possible four axes are numbered with 1-4, such that the first input axis
is 1, the second is 2 and so on. The output ordering is controlled by a list of the
input axes re-ordered to the new mapping.

Examples
################################################################################

Reversing the order of the axes::

    +proj=axisswap +order=4,3,2,1

Swapping the first two axes (x and y)::

    +proj=axisswap +order=2,1,3,4

The direction, or sign, of an axis can be changed by adding a minus in
front of the axis-number::

    +proj=axisswap +order=1,-2,3,4

It is only necessary to specify the axes that are affected by the swap
operation::

    +proj=axisswap +order=2,1