{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For example, a power of 2 will double the angle of rotation, and a power of 0.5 will halve the angle. There are three notable cases: if "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n == 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " then the original rotation is returned, if "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n == 0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " then the identity rotation is returned, and if "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n == -1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " then "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p.inv()"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " 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": "power",
              "annotation": "`Rotation` instance",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The resulting rotation will be of the same shape as the original rotation object. Each element of the output is the corresponding element of the input rotation raised to the power of "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "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 rotation 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 | Array",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The number of times to compose the rotation with itself. If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "n"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is an array, then it must be 0d or 1d with shape (1,)."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "modulus",
              "annotation": "None",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "This overridden argument is not applicable to Rotations and must be "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "None"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "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 rotation "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " with itself can be extended to non-integer "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " by considering the power "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " to be a scale factor applied to the angle of rotation about the rotation's fixed axis. The expression "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "q = p ** n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " can also be expressed as "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "q = Rotation.from_rotvec(n * p.as_rotvec())"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is negative, then the rotation 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/_rotation.py",
  "item_line": 1812,
  "item_type": "function",
  "aliases": [
    "scipy.spatial.transform.Rotation.__pow__"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from scipy.spatial.transform import Rotation as R\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nRaising a rotation to a power:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "p = R.from_rotvec([1, 0, 0])\nq = p ** 2\nq.as_rotvec()\nr = p ** 0.5\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "r.as_rotvec()\n",
        "execution_status": "failure",
        "out": "array([0.5, 0. , 0. ])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nInverse powers do not necessarily cancel out:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "p = R.from_rotvec([0, 0, 120], degrees=True)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "((p ** 2) ** 0.5).as_rotvec(degrees=True)\n",
        "execution_status": "failure",
        "out": "array([ -0.,  -0., -60.])\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 | Array",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "modulus",
        "annotation": "None",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      }
    ],
    "return_annotation": "Rotation",
    "target_name": "__pow__"
  },
  "references": null,
  "qa": "scipy.spatial.transform._rotation:Rotation.__pow__",
  "arbitrary": [],
  "local_refs": [
    "modulus",
    "n",
    "power"
  ]
}