{
  "__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": "transform",
              "annotation": "`RigidTransform` instance",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Rigid transform objects. The shape is determined by broadcasting the translation and rotation shapes together."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Initialize a rigid transform from translation and rotation components."
            }
          ]
        }
      ],
      "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": "translation",
              "annotation": "array_like, shape (..., 3)",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Translation vectors. Each translation[..., :] represents a 3D translation vector."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "rotation",
              "annotation": "`Rotation` instance",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Rotation objects. The shape must be broadcastable with the translation shape."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When creating a rigid transform from a translation and rotation, the translation is applied after the rotation, such that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "tf = Tf.from_components(translation, rotation)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is equivalent to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "tf = Tf.from_translation(translation) * Tf.from_rotation(rotation)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When applying a transform to a vector "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "v"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the result is the same as if the transform was applied to the vector in the following way: "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "tf.apply(v) == translation + rotation.apply(v)"
            }
          ]
        }
      ],
      "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": 689,
  "item_type": "staticmethod",
  "aliases": [
    "scipy.spatial.transform.RigidTransform.from_components"
  ],
  "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": "\nCreating from a single rotation and translation:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "t = np.array([2, 3, 4])\nr = R.from_euler(\"ZYX\", [90, 30, 0], degrees=True)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "r.as_matrix()\n",
        "execution_status": "failure",
        "out": "array([[ 0.     , -1.     ,  0.     ],\n       [ 0.86603,  0.     ,  0.5    ],\n       [-0.5    ,  0.     ,  0.86603]])\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf = Tf.from_components(t, r)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf.rotation.as_matrix()\n",
        "execution_status": "failure",
        "out": "array([[ 0.     , -1.     ,  0.     ],\n       [ 0.86603,  0.     ,  0.5    ],\n       [-0.5    ,  0.     ,  0.86603]])\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf.translation\ntf.single\n",
        "execution_status": "success",
        "out": "True\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nWhen applying a transform to a vector ``v``, the result is the same as\nif the transform was applied to the vector in the following way:\n``tf.apply(v) == translation + rotation.apply(v)``\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "r.apply([1, 0, 0])\nt + r.apply([1, 0, 0])\ntf.apply([1, 0, 0])\n",
        "execution_status": "failure",
        "out": "array([2.     , 3.86603, 3.5    ])\n"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "translation",
        "annotation": "ArrayLike",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "rotation",
        "annotation": "Rotation",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": "RigidTransform",
    "target_name": "from_components"
  },
  "references": null,
  "qa": "scipy.spatial.transform._rigid_transform:RigidTransform.from_components",
  "arbitrary": [],
  "local_refs": [
    "rotation",
    "transform",
    "translation"
  ]
}