{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "There are three notable cases: if "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n == 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " then a copy of the original transform is returned, if "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n == 0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " then the identity transform is returned, and if "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n == -1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " then the inverse transform is returned."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Note that fractional powers "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " which effectively take a root of rotation, do so using the shortest path smallest representation of that angle (the principal root). This means that powers of "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "1/n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are not necessarily inverses of each other. For example, a 0.5 power of a +240 degree rotation will be calculated as the 0.5 power of a -120 degree rotation, with the result being a rotation of -60 rather than +120 degrees."
            }
          ]
        }
      ],
      "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": "If the input Rotation "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "p",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " contains "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "N",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " multiple rotations, then the output will contain "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "N",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " rotations where the "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "i",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " th rotation is equal to "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "p[i] ** n"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Compose this transform with itself "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " times."
            }
          ]
        }
      ],
      "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": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "n",
              "annotation": "float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The number of times to compose the transform with itself."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A rigid transform "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "p",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " when raised to non-integer powers can be thought of as finding a fraction of the transformation. For example, a power of 0.5 finds a \"halfway\" transform from the identity to "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "p",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This is implemented by applying screw linear interpolation (ScLERP) between "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "p",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and the identity transform, where the angle of the rotation component is scaled by "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", and the translation is proportionally adjusted along the screw axis."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "q = p ** n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " can also be expressed as "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "q = RigidTransform.from_exp_coords(p.as_exp_coords() * n)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is negative, then the transform is inverted before the power is applied. In other words, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p ** -abs(n) == p.inv() ** abs(n)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "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": "build-install/usr/lib/python3.14/site-packages/scipy/spatial/transform/_rigid_transform.py",
  "item_line": 1575,
  "item_type": "function",
  "aliases": [
    "scipy.spatial.transform.RigidTransform.__pow__"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from scipy.spatial.transform import RigidTransform as Tf\nimport numpy as np\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nA power of 2 returns the transform composed with itself:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf = Tf.from_translation([1, 2, 3])\n(tf ** 2).translation\n(tf ** 2).as_matrix()\n",
        "execution_status": "success",
        "out": "array([[1., 0., 0., 2.],\n       [0., 1., 0., 4.],\n       [0., 0., 1., 6.],\n       [0., 0., 0., 1.]])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nA negative power returns the inverse of the transform raised to the\nabsolute value of `n`:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "(tf ** -2).translation\nnp.allclose((tf ** -2).as_matrix(), (tf.inv() ** 2).as_matrix(),\n            atol=1e-12)\n",
        "execution_status": "success",
        "out": "True\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nA power of 0 returns the identity transform:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "(tf ** 0).as_matrix()\n",
        "execution_status": "success",
        "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": "\nA power of 1 returns a copy of the original transform:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "(tf ** 1).as_matrix()\n",
        "execution_status": "success",
        "out": "array([[1., 0., 0., 1.],\n       [0., 1., 0., 2.],\n       [0., 0., 1., 3.],\n       [0., 0., 0., 1.]])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nA fractional power returns a transform with a scaled rotation and\ntranslated along the screw axis. Here we take the square root of the\ntransform, which when squared recovers the original transform:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf_half = (tf ** 0.5)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf_half.translation\n",
        "execution_status": "failure",
        "out": "array([0.5, 1. , 1.5])\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "(tf_half ** 2).as_matrix()\n",
        "execution_status": "success",
        "out": "array([[1., 0., 0., 1.],\n       [0., 1., 0., 2.],\n       [0., 0., 1., 3.],\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
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "n",
        "annotation": "float",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": "RigidTransform",
    "target_name": "__pow__"
  },
  "references": null,
  "qa": "scipy.spatial.transform._rigid_transform:RigidTransform.__pow__",
  "arbitrary": [],
  "local_refs": [
    "n"
  ]
}