{
  "__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": "Object containing the rigid transform represented by the input rotation."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Initialize from a rotation, without a translation."
            }
          ]
        }
      ],
      "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": "rotation",
              "annotation": "`Rotation` instance",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A single rotation or a rotation with N leading dimensions."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When applying this transform to a vector "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "v"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the result is the same as if the rotation was applied to the vector. "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "Tf.from_rotation(r).apply(v) == r.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": "build-install/usr/lib/python3.14/site-packages/scipy/spatial/transform/_rigid_transform.py",
  "item_line": 550,
  "item_type": "staticmethod",
  "aliases": [
    "scipy.spatial.transform.RigidTransform.from_rotation"
  ],
  "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 a transform from a single rotation:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "r = R.from_euler(\"ZYX\", [90, 30, 0], degrees=True)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "r.apply([1, 0, 0])\n",
        "execution_status": "failure",
        "out": "array([ 0.     ,  0.86603, -0.5    ])\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf = Tf.from_rotation(r)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf.apply([1, 0, 0])\n",
        "execution_status": "failure",
        "out": "array([ 0.     ,  0.86603, -0.5    ])\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf.single\n",
        "execution_status": "success",
        "out": "True\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe upper 3x3 submatrix of the transformation matrix is the rotation\nmatrix:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.allclose(tf.as_matrix()[:3, :3], r.as_matrix(), atol=1e-12)\n",
        "execution_status": "success",
        "out": "True\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nCreating multiple transforms from a rotation with N leading dimensions:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "r = R.from_euler(\"ZYX\", [[90, 30, 0], [45, 30, 60]], degrees=True)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "r.apply([1, 0, 0])\n",
        "execution_status": "failure",
        "out": "array([[ 0.     ,  0.86603, -0.5    ],\n       [ 0.61237,  0.61237, -0.5    ]])\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf = Tf.from_rotation(r)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf.apply([1, 0, 0])\n",
        "execution_status": "failure",
        "out": "array([[ 0.     ,  0.86603, -0.5    ],\n       [ 0.61237,  0.61237, -0.5    ]])\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tf.single\nlen(tf)\n",
        "execution_status": "success",
        "out": "2\n"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "rotation",
        "annotation": "Rotation",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": "RigidTransform",
    "target_name": "from_rotation"
  },
  "references": null,
  "qa": "scipy.spatial.transform._rigid_transform:RigidTransform.from_rotation",
  "arbitrary": [],
  "local_refs": [
    "rotation",
    "transform"
  ]
}