{
  "__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 composed transform."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "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 the other."
            }
          ]
        }
      ],
      "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": "other",
              "annotation": "`RigidTransform` or `Rotation` instance",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Transform(s) or rotation(s) to be composed with this one. The shapes must be broadcastable."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "q"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are two transforms, then the composition of '"
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "q"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " followed by "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "' is equivalent to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p * q"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". In terms of transformation matrices, the composition can be expressed as "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p.as_matrix() @ q.as_matrix()"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In terms of translations and rotations, the composition when applied to a vector "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "v"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is equivalent to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p.translation + p.rotation.apply(q.translation) + (p.rotation * q.rotation).apply(v)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This function supports composition of multiple transforms at a time using broadcasting rules. The resulting shape for two "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "RigidTransform",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.spatial.transform._rigid_transform:RigidTransform"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " instances "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "p"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "q"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "np.broadcast_shapes(p.shape, q.shape)",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "other"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is a "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "Rotation",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.spatial.transform._rotation:Rotation"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", it is automatically promoted to a "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "RigidTransform",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.spatial.transform._rigid_transform:RigidTransform"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " with zero translation."
            }
          ]
        }
      ],
      "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": 1453,
  "item_type": "function",
  "aliases": [
    "scipy.spatial.transform.RigidTransform.__mul__"
  ],
  "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": "\nCompose two transforms:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf1 = Tf.from_translation([1, 0, 0])\ntf2 = Tf.from_translation([0, 1, 0])\ntf = tf1 * tf2\ntf.translation\ntf.single\n",
        "execution_status": "success",
        "out": "True\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nWhen applied to a vector, the composition of two transforms is applied\nin right-to-left order.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "t1, r1 = [1, 2, 3], R.from_euler('z', 60, degrees=True)\nt2, r2 = [0, 1, 0], R.from_euler('x', 30, degrees=True)\ntf1 = Tf.from_components(t1, r1)\ntf2 = Tf.from_components(t2, r2)\ntf = tf1 * tf2\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf.apply([1, 0, 0])\ntf1.apply(tf2.apply([1, 0, 0]))\n",
        "execution_status": "failure",
        "out": "array([0.63397, 3.36603, 3.     ])\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nWhen at least one of the transforms is not single, the result is a stack\nof transforms.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf1 = Tf.from_translation([1, 0, 0])\ntf2 = Tf.from_translation([[0, 2, 0], [0, 0, 3]])\ntf = tf1 * tf2\ntf.translation\ntf.single\nlen(tf)\n",
        "execution_status": "success",
        "out": "2\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nBroadcasting rules apply when composing multiple transforms at a time.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf1 = Tf.from_translation(np.ones((5, 1, 3)))  # Shape (5, 1, 3)\ntf2 = Tf.from_translation(np.ones((1, 4, 3)))  # Shape (1, 4, 3)\ntf = tf1 * tf2  # Shape (5, 4, 3)\ntf.translation.shape\n",
        "execution_status": "success",
        "out": "(5, 4, 3)\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": "other",
        "annotation": "RigidTransform | Rotation",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": "RigidTransform",
    "target_name": "__mul__"
  },
  "references": null,
  "qa": "scipy.spatial.transform._rigid_transform:RigidTransform.__mul__",
  "arbitrary": [],
  "local_refs": [
    "other"
  ]
}