{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "`RigidTransform` instance",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The inverse of this transform."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Invert this transform."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Composition of a transform with its inverse results in an identity transform."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A rigid transform is a composition of a rotation and a translation, where the rotation is applied first, followed by the translation. So the inverse transform is equivalent to the inverse translation followed by the inverse rotation."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/spatial/transform/_rigid_transform.py",
  "item_line": 1680,
  "item_type": "function",
  "aliases": [
    "scipy.spatial.transform.RigidTransform.inv"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from scipy.spatial.transform import RigidTransform as Tf\nfrom scipy.spatial.transform import Rotation as R\nimport numpy as np\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nA transform composed with its inverse results in an identity transform:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "rng = np.random.default_rng(seed=123)\nt = rng.random(3)\nr = R.random(rng=rng)\ntf = Tf.from_components(t, r)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf.as_matrix()\n",
        "execution_status": "failure",
        "out": "array([[-0.45431,  0.67276, -0.58394,  0.68235],\n       [-0.23272,  0.54311,  0.80677,  0.05382],\n       [ 0.85991,  0.50242, -0.09017,  0.22036],\n       [ 0.     ,  0.     ,  0.     ,  1.     ]])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "(tf.inv() * tf).as_matrix()\n",
        "execution_status": "failure",
        "out": "array([[1., 0., 0., 0.],\n       [0., 1., 0., 0.],\n       [0., 0., 1., 0.],\n       [0., 0., 0., 1.]])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe inverse rigid transform is the same as the inverse translation\nfollowed by the inverse rotation:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "t, r = tf.as_components()\nr_inv = r.inv()  # inverse rotation\nt_inv = -t  # inverse translation\ntf_r_inv = Tf.from_rotation(r_inv)\ntf_t_inv = Tf.from_translation(t_inv)\nnp.allclose((tf_r_inv * tf_t_inv).as_matrix(),\n            tf.inv().as_matrix(),\n            atol=1e-12)\n",
        "execution_status": "success",
        "out": "True\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "(tf_r_inv * tf_t_inv * tf).as_matrix()\n",
        "execution_status": "failure",
        "out": "array([[ 1., -0.,  0.,  0.],\n       [ 0.,  1.,  0.,  0.],\n       [-0., -0.,  1.,  0.],\n       [ 0.,  0.,  0.,  1.]])\n"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "self",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": "RigidTransform",
    "target_name": "inv"
  },
  "references": null,
  "qa": "scipy.spatial.transform._rigid_transform:RigidTransform.inv",
  "arbitrary": [],
  "local_refs": []
}