2024-04-09 11:56:43 +05:30
|
|
|
|
{
|
|
|
|
|
"cells": [
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "e2ae546c-570b-4245-99fa-60519f448e1e",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"# Code to verify and visualize reorientation caused twinning in the deformation gradient.\n",
|
|
|
|
|
"## Using the correspondence matrix method.\n",
|
|
|
|
|
"By Satyapriya Gupta, Achal H P\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"Reference Niewczas, Acta Materialia, 2010"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 1,
|
|
|
|
|
"id": "8faa8558-2109-45ed-b795-94150b3c998d",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"import math\n",
|
|
|
|
|
"import numpy as np\n",
|
|
|
|
|
"import scipy.linalg\n",
|
|
|
|
|
"from numpy.linalg import inv\n",
|
|
|
|
|
"import damask"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "bc185fbf-e55d-445e-b8aa-f17abdd93b9a",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### Test Case: Extension Twinning $( \\bar{1} 0 1 2)$ $[1 0 \\bar{1} 1] $\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"Conversion to Miller indices: $ (\\bar{1} 0 2) [2 1 1] $"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 2,
|
|
|
|
|
"id": "fee7fbb5-3a4b-421c-bbe7-636c3fd412e9",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"2.3743159014756228\n",
|
|
|
|
|
"1.6881920256873888\n",
|
|
|
|
|
"[0.63176092 0.36474734 0.68398649]\n",
|
|
|
|
|
"[-0.59234968 -0.34199325 0.72949468]\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"# Twin direction:\n",
|
|
|
|
|
"m = np.array([2, 1, 1])\n",
|
|
|
|
|
"# Habit plane normal\n",
|
|
|
|
|
"n = np.array([-1, 0, 2])\n",
|
|
|
|
|
"# Mapping from Miller indes to cartesian coordinate system\n",
|
|
|
|
|
"matA=np.array([[1, -0.5, 0],[0, 0.5*np.sqrt(3), 0],[0, 0, 1.624]])\n",
|
|
|
|
|
"#norm of twin direction\n",
|
|
|
|
|
"norm_mcart=np.linalg.norm(np.matmul(matA,m))\n",
|
|
|
|
|
"# norm of twin plane\n",
|
|
|
|
|
"norm_ncart=np.linalg.norm(np.matmul(n,inv(matA)))\n",
|
|
|
|
|
"# normalized unit vectors:\n",
|
|
|
|
|
"unit_mcart = np.matmul(matA,m)/norm_mcart\n",
|
|
|
|
|
"unit_ncart = np.matmul(n, inv(matA))/norm_ncart\n",
|
|
|
|
|
"# Characteristic shear for Extension twin of Mg\n",
|
|
|
|
|
"s = 0.128917\n",
|
|
|
|
|
"print(norm_mcart)\n",
|
|
|
|
|
"print(norm_ncart)\n",
|
|
|
|
|
"print(unit_mcart)\n",
|
|
|
|
|
"print(unit_ncart)"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "716495ad-76ca-4790-b1f4-a2f249e452db",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### Please provide Euler Angles Here:"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 3,
|
|
|
|
|
"id": "eaa69469-71ca-42fc-a4ed-afa0fb84a230",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
2024-04-09 16:02:37 +05:30
|
|
|
|
"[[-0.94733416 -0.26950574 0.17298739]\n",
|
|
|
|
|
" [-0.18994613 0.03796355 -0.98106026]\n",
|
|
|
|
|
" [ 0.25783416 -0.96225019 -0.08715574]]\n"
|
2024-04-09 11:56:43 +05:30
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
2024-04-09 16:02:37 +05:30
|
|
|
|
"phi_1 = 15\n",
|
|
|
|
|
"phi_ = 95\n",
|
|
|
|
|
"phi_2 = 170\n",
|
2024-04-09 11:56:43 +05:30
|
|
|
|
"\n",
|
|
|
|
|
"init = damask.Orientation.from_Euler_angles(phi=[phi_1,phi_,phi_2],degrees=True,family='hexagonal',lattice='hP',a=1.0,b=1.0,c=1.6235).as_matrix()\n",
|
|
|
|
|
"print(init)\n"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "1262386a-1d9c-4bb0-a147-c409f45ec751",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### Initial Undeformed Condition, $ F = Identity matrix $"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 4,
|
|
|
|
|
"id": "689c6399-fd48-4456-be57-a8f7f7e16276",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"F = np.identity(3)"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "64b46853-7012-432f-93c1-4acb1fe4dc9a",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### If $F = I$, then inverse of $F$ gives $F_e$."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 5,
|
|
|
|
|
"id": "3c3bfb00-2af0-4754-8d4e-89ee10d62519",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"Fp=init\n",
|
|
|
|
|
"Fe=inv(Fp)\n",
|
|
|
|
|
"Rinv = inv(init)"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "6786e80d-c9b2-41de-9fc1-40e8d3fc5acd",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### Shape change by twinning in the reference configuration:"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 6,
|
|
|
|
|
"id": "83c683bf-e3b8-4ec3-9e59-d0a25a55ca0e",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"deformation gradient of shape change= \n",
|
2024-04-09 16:02:37 +05:30
|
|
|
|
" [[ 0.94841878 0.03517917 -0.01073607]\n",
|
|
|
|
|
" [-0.0855022 1.05831379 -0.01779635]\n",
|
|
|
|
|
" [-0.03234646 0.02206077 0.99326744]]\n"
|
2024-04-09 11:56:43 +05:30
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"S_ref= s * np.einsum('i,j',np.matmul(Rinv,unit_mcart),np.matmul(Rinv,unit_ncart)) + np.identity(3)\n",
|
|
|
|
|
"print(\"deformation gradient of shape change= \\n\", S_ref)"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "eb708c6b-38ea-4f4a-ac59-91e31b55df95",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### After twinning, $ F_1 = Fe_1 * {F_p}_1 $ , where $ {F_p}_1 = C * {F_p}$"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 7,
|
|
|
|
|
"id": "b1ad7d3a-fcf2-4116-9339-0451961ece5d",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
2024-04-09 16:02:37 +05:30
|
|
|
|
"with determinant of 1.0000001660951479\n"
|
2024-04-09 11:56:43 +05:30
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"F1=S_ref\n",
|
|
|
|
|
"C=np.array([[-0.25,0.433013,-0.923645],[0.433013,-0.75,-0.533267],[-0.812, -0.468808, 0]])\n",
|
|
|
|
|
"Fe1=np.matmul(F1,inv(np.matmul(C,Fp)))\n",
|
|
|
|
|
"print (\"with determinant of \",np.linalg.det(Fe1))"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "d21c31d5-72b1-43ed-91e4-2b194cd4eaaf",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### Right polar decomposition of $F_e$, $ F_e = R U $ gives the rotation of deformed voxel."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 8,
|
|
|
|
|
"id": "9e5edf14-8645-4816-86ee-89d0fb02335e",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
2024-04-09 16:02:37 +05:30
|
|
|
|
"[203.36501298 70.4635392 80.71378207]\n"
|
2024-04-09 11:56:43 +05:30
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"(R_,U_) = scipy.linalg.polar(Fe1,'right')\n",
|
|
|
|
|
"check = damask.Orientation.from_matrix(R=R_,family='hexagonal',lattice='hP',a=1.0,b=1.0,c=1.6235).as_Euler_angles(degrees=True)\n",
|
|
|
|
|
"print(check)"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "749c4997-c181-41c7-8359-f0fd37ee1a38",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### Get the orientation details"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 9,
|
|
|
|
|
"id": "e6e8b162-7e0b-45dc-a37f-bee3071ce353",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
2024-04-09 16:02:37 +05:30
|
|
|
|
"[ 99.28621793 70.4635392 336.63498702]\n"
|
2024-04-09 11:56:43 +05:30
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"new_ori = damask.Orientation.from_matrix(R=np.linalg.inv(R_),family='hexagonal',lattice='hP',a=1.0,b=1.0,c=1.6235)\n",
|
|
|
|
|
"print(damask.Orientation.from_matrix(R=np.linalg.inv(R_),family='hexagonal',lattice='hP',a=1.0,b=1.0,c=1.6235).as_Euler_angles(degrees=True))"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 10,
|
|
|
|
|
"id": "80ac2638-3ebd-47c6-8e80-243a1c69fce1",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"Crystal family: hexagonal\n",
|
|
|
|
|
"Bravais lattice: hP\n",
|
|
|
|
|
"a=1 m, b=1 m, c=1.6235 m\n",
|
|
|
|
|
"α=90°, β=90°, γ=120°\n",
|
2024-04-09 16:02:37 +05:30
|
|
|
|
"Quaternion [ 0.02946883 -0.15957602 0.71980092 -0.6749472 ]\n"
|
2024-04-09 11:56:43 +05:30
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"old_ori = damask.Orientation.from_Euler_angles(phi=[phi_1,phi_,phi_2],degrees=True,family='hexagonal',lattice='hP',a=1.0,b=1.0,c=1.6235)\n",
|
|
|
|
|
"print(old_ori)"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 11,
|
|
|
|
|
"id": "cc1b231c-16e6-4d7d-bda2-8d0a4799839f",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"Crystal family: hexagonal\n",
|
|
|
|
|
"Bravais lattice: hP\n",
|
|
|
|
|
"a=1 m, b=1 m, c=1.6235 m\n",
|
|
|
|
|
"α=90°, β=90°, γ=120°\n",
|
2024-04-09 16:02:37 +05:30
|
|
|
|
"Quaternion [7.29494643e-01 6.83986524e-01 3.14974754e-08 1.07984812e-07]\n",
|
2024-04-09 11:56:43 +05:30
|
|
|
|
"[ 0. 86.31191012 0. ]\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"dis = old_ori.disorientation(new_ori)\n",
|
|
|
|
|
"print(dis)\n",
|
|
|
|
|
"print(dis.as_Euler_angles(degrees=True))"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "3efee0a1-5ebe-42bd-bb05-61721097458d",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"## Result: Print the disorientation between undeformed and deformed voxel."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 12,
|
|
|
|
|
"id": "10b562ea-c067-4ec0-8b26-59dd8722305a",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"disorientation = 86.31191011698503 degrees\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"print('disorientation =',dis.as_axis_angle(degrees=True,pair=True)[1],'degrees')"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "10bdf007-9926-4e38-9195-dd3fd349f634",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"# Code to visualization of lattice reorientation caused by twinning.\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"First cell below gives HCP unit cell with euler angles 0,0,0.\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"Second cell below rotates unit cell by provided euler angles.\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"Third cell below shows reorientation done after twinning."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 13,
|
|
|
|
|
"id": "37f8aa5b-a6df-45be-861f-46bdd218154a",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"data": {
|
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAOcAAADnCAYAAADl9EEgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAA0N0lEQVR4nO2deVxVdf7/n/deVlcE3MgNcxl3bUFxAVGRRZBraqilqfWo7GuPps0Wq286My1OzdS3ZuZXM4XWJCigoAIXUeSaYaWlraamoqbiAqJswl3O7w+6pyuxc+6958B5Ph4+plE453OX13m/P+/toxEEARUVFfmhdfUCVFRU6kYVp4qKTFHFqaIiU1RxqqjIFFWcKioyxa2Rf1dDuSoqjkdT11+qllNFRaao4lRRkSmqOFVUZIoqThUVmaKKU0VFpqjiVFGRKao4VVRkiipOFRWZoopTRUWmqOJUUZEpqjhVVGSKKk4VFZmiilNFRaao4lRRkSmqOFVUZIoqThcgCAIWiwV18qFKQzTWbK0iMYIgUF1dzY0bNxAEAZ1Oh7u7O25ubuh0OjSaOvtuVdohmkae3uqjXUKsVivV1dUIgoDZbEYQBPGPDVWs7ZI6P2RVnE7AJkaz2SyKzWQy1flzgiBgtVrFn1PF2i5QxekKrFYrJpNJFJxGoxFd28aEVpdY3dzcxD+qWNsMdX6I6p7TQdiCPjYLaRNmc7D9jlar/d017cVqs6xarVYVaxtCFacDqO3GSiWY+sRqNpvFf7d3g1WxKhtVnBJTlxtbH4IgtEo8ta9fl1jt3WBVrMpC3XNKRG2XszER2KK2jhRL7WiwKlbZogaEHIUgCJhMJiwWS5PdWGeIsza24JINm1jd3d3R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"metadata": {},
|
|
|
|
|
"output_type": "display_data"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"import numpy as np\n",
|
|
|
|
|
"import matplotlib.pyplot as plt\n",
|
|
|
|
|
"from mpl_toolkits.mplot3d import Axes3D\n",
|
|
|
|
|
"from math import cos, sin, radians\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Define the line\n",
|
|
|
|
|
"x = np.linspace(0, 1.2, 100)\n",
|
|
|
|
|
"y = np.zeros_like(x)\n",
|
|
|
|
|
"z = np.zeros_like(x)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"x1 = np.zeros_like(x)\n",
|
|
|
|
|
"y1 = np.zeros_like(x)\n",
|
|
|
|
|
"z1 = np.linspace(0, 1.2, 100)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"x2 = np.zeros_like(x)\n",
|
|
|
|
|
"y2 = np.linspace(0, 1.2, 100)\n",
|
|
|
|
|
"z2 = np.zeros_like(x)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"h11 = np.linspace(1,0.5,100)\n",
|
|
|
|
|
"h12 = h11*np.sqrt(3) - np.sqrt(3)\n",
|
|
|
|
|
"h13 = np.zeros_like(h11)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"h21 = np.linspace(-0.5, 0.5, 100)\n",
|
|
|
|
|
"h22 = np.ones_like(h21) * np.sqrt(3) / 2\n",
|
|
|
|
|
"h23 = np.zeros_like(h21)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"h31 = np.linspace(-0.5, 0.5, 100)\n",
|
|
|
|
|
"h32 = - np.ones_like(h31) * np.sqrt(3) / 2\n",
|
|
|
|
|
"h33 = np.zeros_like(h31)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"h41 = np.linspace(1,0.5,100)\n",
|
|
|
|
|
"h42 = - h41*np.sqrt(3) + np.sqrt(3)\n",
|
|
|
|
|
"h43 = np.zeros_like(h41)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"h51 = np.linspace(-1,-0.5,100)\n",
|
|
|
|
|
"h52 = - h51*np.sqrt(3) - np.sqrt(3)\n",
|
|
|
|
|
"h53 = np.zeros_like(h51)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"h61 = np.linspace(-1,-0.5,100)\n",
|
|
|
|
|
"h62 = h61*np.sqrt(3) + np.sqrt(3)\n",
|
|
|
|
|
"h63 = np.zeros_like(h61)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"k11 = np.linspace(1,0.5,100)\n",
|
|
|
|
|
"k12 = k11*np.sqrt(3) - np.sqrt(3)\n",
|
|
|
|
|
"k13 = np.ones_like(k11)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"k21 = np.linspace(-0.5, 0.5, 100)\n",
|
|
|
|
|
"k22 = np.ones_like(k21) * np.sqrt(3) / 2\n",
|
|
|
|
|
"k23 = np.ones_like(k21)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"k31 = np.linspace(-0.5, 0.5, 100)\n",
|
|
|
|
|
"k32 = - np.ones_like(k31) * np.sqrt(3) / 2\n",
|
|
|
|
|
"k33 = np.ones_like(k31)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"k41 = np.linspace(1,0.5,100)\n",
|
|
|
|
|
"k42 = - k41*np.sqrt(3) + np.sqrt(3)\n",
|
|
|
|
|
"k43 = np.ones_like(k41)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"k51 = np.linspace(-1,-0.5,100)\n",
|
|
|
|
|
"k52 = - k51*np.sqrt(3) - np.sqrt(3)\n",
|
|
|
|
|
"k53 = np.ones_like(k51)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"k61 = np.linspace(-1,-0.5,100)\n",
|
|
|
|
|
"k62 = k61*np.sqrt(3) + np.sqrt(3)\n",
|
|
|
|
|
"k63 = np.ones_like(k61)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"v11 = np.ones_like(x) * 0.5\n",
|
|
|
|
|
"v12 = np.ones_like(x) * np.sqrt(3) / 2\n",
|
|
|
|
|
"v13 = np.linspace(0, 1, 100)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"v21 = - np.ones_like(x) * 0.5\n",
|
|
|
|
|
"v22 = np.ones_like(x) * np.sqrt(3) / 2\n",
|
|
|
|
|
"v23 = np.linspace(0, 1, 100)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"v31 = - np.ones_like(x) * 0.5\n",
|
|
|
|
|
"v32 = - np.ones_like(x) * np.sqrt(3) / 2\n",
|
|
|
|
|
"v33 = np.linspace(0, 1, 100)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"v41 = np.ones_like(x) * 0.5\n",
|
|
|
|
|
"v42 = - np.ones_like(x) * np.sqrt(3) / 2\n",
|
|
|
|
|
"v43 = np.linspace(0, 1, 100)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"v51 = - np.ones_like(x)\n",
|
|
|
|
|
"v52 = np.zeros_like(x)\n",
|
|
|
|
|
"v53 = np.linspace(0, 1, 100)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"v61 = np.ones_like(x)\n",
|
|
|
|
|
"v62 = np.zeros_like(x)\n",
|
|
|
|
|
"v63 = np.linspace(0, 1, 100)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Plot the line\n",
|
|
|
|
|
"fig = plt.figure()\n",
|
|
|
|
|
"ax = fig.add_subplot(111, projection='3d')\n",
|
|
|
|
|
"ax.plot(x, y, z)\n",
|
|
|
|
|
"ax.plot(x1, y1, z1)\n",
|
|
|
|
|
"#ax.plot(x2, y2, z2)\n",
|
|
|
|
|
"ax.plot(h11, h12, h13, 'k-')\n",
|
|
|
|
|
"ax.plot(h21, h22, h23, 'k-')\n",
|
|
|
|
|
"ax.plot(h31, h32, h33, 'k-')\n",
|
|
|
|
|
"ax.plot(h41, h42, h43, 'k-')\n",
|
|
|
|
|
"ax.plot(h51, h52, h53, 'k-')\n",
|
|
|
|
|
"ax.plot(h61, h62, h63, 'k-')\n",
|
|
|
|
|
"ax.plot(k11, k12, k13, 'k-')\n",
|
|
|
|
|
"ax.plot(k21, k22, k23, 'k-')\n",
|
|
|
|
|
"ax.plot(k31, k32, k33, 'k-')\n",
|
|
|
|
|
"ax.plot(k41, k42, k43, 'k-')\n",
|
|
|
|
|
"ax.plot(k51, k52, k53, 'k-')\n",
|
|
|
|
|
"ax.plot(k61, k62, k63, 'k-')\n",
|
|
|
|
|
"ax.plot(v11, v12, v13, 'k-')\n",
|
|
|
|
|
"ax.plot(v21, v22, v23, 'k-')\n",
|
|
|
|
|
"ax.plot(v31, v32, v33, 'k-')\n",
|
|
|
|
|
"ax.plot(v41, v42, v43, 'k-')\n",
|
|
|
|
|
"ax.plot(v51, v52, v53, 'k-')\n",
|
|
|
|
|
"ax.plot(v61, v62, v63, 'k-')\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"ax.set_xticks([])\n",
|
|
|
|
|
"ax.set_yticks([])\n",
|
|
|
|
|
"ax.set_zticks([])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"ax.set_xlabel('')\n",
|
|
|
|
|
"ax.set_ylabel('')\n",
|
|
|
|
|
"ax.set_zlabel('')\n",
|
|
|
|
|
"plt.show()"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 14,
|
|
|
|
|
"id": "a523f432-ce0a-4506-9d83-bd469e1c9ba3",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"data": {
|
2024-04-09 16:02:37 +05:30
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAOcAAADnCAYAAADl9EEgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYA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ODg6sXbuW06dP07VrVxYuXEjLli1ZsmQJqampolzD1tYWgPj4+CLfoxLp5cuX84nU09NTZyLN27hL06SmphqW51QNYxUKxYsLG8AwFmDLli106tSJ7OxsDh48yPDhw3VtUom8+eabbNy4kdjYWNq1a8fs2bNxcnJi5cqVZGRkVOjc9erVA4oXp4qCIr1+/bpORKpNYQKkp6dXuFwMtCROVcK6IQ1js7OzmTJlCkOHDqVNmzacOHGCdu3a6dqsMuHs7ExoaCjR0dG0aNGCadOm4eLiwrp169QPybKi8pyPHj0q9THFifT48ePlsqOsaPOeM4hhbcG1S0MRZmJiIr1792bFihWMHTuWqKgobGxsRL2GNj+Htm3bsmvXLvbs2UPDhg353//+R5s2bdi0aVO+wE5pqFOnDiYmJqXynAUpTKTvvfceHh4eGhWptu85vQ8IFbZ2aQjCPHv2LO3bt+fs2bMEBwezZMkSTExMdG2WKLi5uXHgwAHCwsKoXbs2Y8aMoW3btoSFheWrYikOuVxO3bp1y+Q5C5JXpF9++SW//fabVkSqLfRanIa4dgkQEhJCt27dMDY25ujRo/j5+enaJNGRyWT06NGDo0ePsmnTJkxMTBg2bBgdOnRgz54
|
2024-04-09 11:56:43 +05:30
|
|
|
|
"text/plain": [
|
|
|
|
|
"<Figure size 432x288 with 1 Axes>"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"output_type": "display_data"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"# Define the rotation angles (in radians)\n",
|
|
|
|
|
"alpha = radians(phi_1) # Rotation around the x-axis\n",
|
|
|
|
|
"beta = radians(phi_) # Rotation around the y-axis\n",
|
|
|
|
|
"gamma = radians(phi_2) # Rotation around the z-axis\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Create the rotation matrices\n",
|
|
|
|
|
"Rx = np.array([[1, 0, 0],\n",
|
|
|
|
|
" [0, cos(alpha), -sin(alpha)],\n",
|
|
|
|
|
" [0, sin(alpha), cos(alpha)]])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"Ry = np.array([[cos(beta), 0, sin(beta)],\n",
|
|
|
|
|
" [0, 1, 0],\n",
|
|
|
|
|
" [-sin(beta), 0, cos(beta)]])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"Rz = np.array([[cos(gamma), -sin(gamma), 0],\n",
|
|
|
|
|
" [sin(gamma), cos(gamma), 0],\n",
|
|
|
|
|
" [0, 0, 1]])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Combine the rotation matrices\n",
|
|
|
|
|
"R = Rz @ Ry @ Rx\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Apply the rotation to the line\n",
|
|
|
|
|
"point1 = np.column_stack((x, y, z))\n",
|
|
|
|
|
"point2 = np.column_stack((x1, y1, z1))\n",
|
|
|
|
|
"point3 = np.column_stack((h11,h12,h13))\n",
|
|
|
|
|
"point4 = np.column_stack((h21, h22, h23))\n",
|
|
|
|
|
"point5 = np.column_stack((h31, h32, h33))\n",
|
|
|
|
|
"point6 = np.column_stack((h41, h42, h43))\n",
|
|
|
|
|
"point7 = np.column_stack((h51, h52, h53))\n",
|
|
|
|
|
"point8 = np.column_stack((h61, h62, h63))\n",
|
|
|
|
|
"point9 = np.column_stack((k11, k12, k13))\n",
|
|
|
|
|
"point10 = np.column_stack((k21, k22, k23))\n",
|
|
|
|
|
"point11 = np.column_stack((k31, k32, k33))\n",
|
|
|
|
|
"point12 = np.column_stack((k41, k42, k43))\n",
|
|
|
|
|
"point13 = np.column_stack((k51, k52, k53))\n",
|
|
|
|
|
"point14 = np.column_stack((k61, k62, k63))\n",
|
|
|
|
|
"point15 = np.column_stack((v11, v12, v13))\n",
|
|
|
|
|
"point16 = np.column_stack((v21, v22, v23))\n",
|
|
|
|
|
"point17 = np.column_stack((v31, v32, v33))\n",
|
|
|
|
|
"point18 = np.column_stack((v41, v42, v43))\n",
|
|
|
|
|
"point19 = np.column_stack((v51, v52, v53))\n",
|
|
|
|
|
"point20 = np.column_stack((v61, v62, v63))\n",
|
|
|
|
|
"point21 = np.column_stack((x2, y2, z2))\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"rotated_point1 = np.dot(R, point1.T).T\n",
|
|
|
|
|
"rotated_point2 = np.dot(R, point2.T).T\n",
|
|
|
|
|
"rotated_point3 = np.dot(R, point3.T).T\n",
|
|
|
|
|
"rotated_point4 = np.dot(R, point4.T).T\n",
|
|
|
|
|
"rotated_point5 = np.dot(R, point5.T).T\n",
|
|
|
|
|
"rotated_point6 = np.dot(R, point6.T).T\n",
|
|
|
|
|
"rotated_point7 = np.dot(R, point7.T).T\n",
|
|
|
|
|
"rotated_point8 = np.dot(R, point8.T).T\n",
|
|
|
|
|
"rotated_point9 = np.dot(R, point9.T).T\n",
|
|
|
|
|
"rotated_point10 = np.dot(R, point10.T).T\n",
|
|
|
|
|
"rotated_point11 = np.dot(R, point11.T).T\n",
|
|
|
|
|
"rotated_point12 = np.dot(R, point12.T).T\n",
|
|
|
|
|
"rotated_point13 = np.dot(R, point13.T).T\n",
|
|
|
|
|
"rotated_point14 = np.dot(R, point14.T).T\n",
|
|
|
|
|
"rotated_point15 = np.dot(R, point15.T).T\n",
|
|
|
|
|
"rotated_point16 = np.dot(R, point16.T).T\n",
|
|
|
|
|
"rotated_point17 = np.dot(R, point17.T).T\n",
|
|
|
|
|
"rotated_point18 = np.dot(R, point18.T).T\n",
|
|
|
|
|
"rotated_point19 = np.dot(R, point19.T).T\n",
|
|
|
|
|
"rotated_point20 = np.dot(R, point20.T).T\n",
|
|
|
|
|
"rotated_point21 = np.dot(R, point21.T).T\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Extract the rotated coordinates\n",
|
|
|
|
|
"x_rotated1, y_rotated1, z_rotated1 = rotated_point1.T\n",
|
|
|
|
|
"x_rotated2, y_rotated2, z_rotated2 = rotated_point2.T\n",
|
|
|
|
|
"x_rotated3, y_rotated3, z_rotated3 = rotated_point3.T\n",
|
|
|
|
|
"x_rotated4, y_rotated4, z_rotated4 = rotated_point4.T\n",
|
|
|
|
|
"x_rotated5, y_rotated5, z_rotated5 = rotated_point5.T\n",
|
|
|
|
|
"x_rotated6, y_rotated6, z_rotated6 = rotated_point6.T\n",
|
|
|
|
|
"x_rotated7, y_rotated7, z_rotated7 = rotated_point7.T\n",
|
|
|
|
|
"x_rotated8, y_rotated8, z_rotated8 = rotated_point8.T\n",
|
|
|
|
|
"x_rotated9, y_rotated9, z_rotated9 = rotated_point9.T\n",
|
|
|
|
|
"x_rotated10, y_rotated10, z_rotated10 = rotated_point10.T\n",
|
|
|
|
|
"x_rotated11, y_rotated11, z_rotated11 = rotated_point11.T\n",
|
|
|
|
|
"x_rotated12, y_rotated12, z_rotated12 = rotated_point12.T\n",
|
|
|
|
|
"x_rotated13, y_rotated13, z_rotated13 = rotated_point13.T\n",
|
|
|
|
|
"x_rotated14, y_rotated14, z_rotated14 = rotated_point14.T\n",
|
|
|
|
|
"x_rotated15, y_rotated15, z_rotated15 = rotated_point15.T\n",
|
|
|
|
|
"x_rotated16, y_rotated16, z_rotated16 = rotated_point16.T\n",
|
|
|
|
|
"x_rotated17, y_rotated17, z_rotated17 = rotated_point17.T\n",
|
|
|
|
|
"x_rotated18, y_rotated18, z_rotated18 = rotated_point18.T\n",
|
|
|
|
|
"x_rotated19, y_rotated19, z_rotated19 = rotated_point19.T\n",
|
|
|
|
|
"x_rotated20, y_rotated20, z_rotated20 = rotated_point20.T\n",
|
|
|
|
|
"x_rotated21, y_rotated21, z_rotated21 = rotated_point21.T\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Plot the line\n",
|
|
|
|
|
"fig = plt.figure()\n",
|
|
|
|
|
"ax = fig.add_subplot(projection='3d')\n",
|
|
|
|
|
"ax.plot(x_rotated1, y_rotated1, z_rotated1)\n",
|
|
|
|
|
"ax.plot(x_rotated2, y_rotated2, z_rotated2)\n",
|
|
|
|
|
"#ax.plot(x_rotated21, y_rotated21, z_rotated21)\n",
|
|
|
|
|
"ax.plot(x_rotated3, y_rotated3, z_rotated3, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated4, y_rotated4, z_rotated4, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated5, y_rotated5, z_rotated5, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated6, y_rotated6, z_rotated6, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated7, y_rotated7, z_rotated7, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated8, y_rotated8, z_rotated8, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated9, y_rotated9, z_rotated9, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated10, y_rotated10, z_rotated10, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated11, y_rotated11, z_rotated11, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated12, y_rotated12, z_rotated12, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated13, y_rotated13, z_rotated13, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated14, y_rotated14, z_rotated14, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated15, y_rotated15, z_rotated15, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated16, y_rotated16, z_rotated16, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated17, y_rotated17, z_rotated17, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated18, y_rotated18, z_rotated18, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated19, y_rotated19, z_rotated19, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated20, y_rotated20, z_rotated20, 'k-')\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"ax.set_xticks([])\n",
|
|
|
|
|
"ax.set_yticks([])\n",
|
|
|
|
|
"ax.set_zticks([])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"ax.set_xlabel('')\n",
|
|
|
|
|
"ax.set_ylabel('')\n",
|
|
|
|
|
"ax.set_zlabel('')\n",
|
|
|
|
|
"plt.show()"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 15,
|
|
|
|
|
"id": "0f461c1e-f9db-4880-8ed3-2a4c841b2251",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"data": {
|
2024-04-09 16:02:37 +05:30
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAOcAAADnCAYAAADl9EEgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAzf0lEQVR4nO2deVxU9frH3zOsrmBqapm75r6xKVgqYZkpS2VkpmKWW5ZLomX3VnqrW/e6lVq5pVe7+Sshr5qWt9QyF2QRFFEyM8t9ZdiHYeac3x/ccxoQBOTMzJnhvF8vXq8SmPOd4XzO83yf77PoRFFEQ0NDfegdvQANDY3y0cSpoaFSNHFqaKgUTZwaGipFE6eGhkpxr+T7WihXQ8P26Mr7R81yamioFE2cGhoqRROnhoZK0cSpoaFSNHFqaKgUTZwaGipFE6eGhkrRxKmhoVI0cWpoqBRNnBoaKkUTp4aGStHEqaGhUjRxamioFE2cGhoqRROnhoZK0cTpAERRxGKxoHU+1LgdlRVbayiMKIqYTCaMRiOiKOLm5oaHhwfu7u64ubmh05Vbd6tRC9FV8vTWHu0KIggCJpMJURQxm82Ioih/SWhirZWU+0fWxGkHJDGazWZZbMXFxeX+nCiKCIIg/5wm1lqBJk5HIAgCxcXFsuB0Op3s2lYmtPLE6u7uLn9pYnUZyv0jantOGyEFfSQLKQmzOki/o9frb3lNa7FKllWv12tidSE0cdqAsm6sUoKpSKxms1n+vrUbrInVudHEqTDlubEVIYpijcRT9vXLE6u1G6yJ1bnQ9pwKUdblrEwEUtTWlmIpGw3W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size 432x288 with 1 Axes>"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"output_type": "display_data"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"# Define the rotation angles (in radians)\n",
|
|
|
|
|
"alpha = damask.Orientation.from_matrix(R=np.linalg.inv(R_),family='hexagonal',lattice='hP',a=1.0,b=1.0,c=1.6235).as_Euler_angles(degrees=False)[0] \n",
|
|
|
|
|
"beta = damask.Orientation.from_matrix(R=np.linalg.inv(R_),family='hexagonal',lattice='hP',a=1.0,b=1.0,c=1.6235).as_Euler_angles(degrees=False)[1] \n",
|
|
|
|
|
"gamma = damask.Orientation.from_matrix(R=np.linalg.inv(R_),family='hexagonal',lattice='hP',a=1.0,b=1.0,c=1.6235).as_Euler_angles(degrees=False)[2] \n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Create the rotation matrices\n",
|
|
|
|
|
"Rx = np.array([[1, 0, 0],\n",
|
|
|
|
|
" [0, cos(alpha), -sin(alpha)],\n",
|
|
|
|
|
" [0, sin(alpha), cos(alpha)]])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"Ry = np.array([[cos(beta), 0, sin(beta)],\n",
|
|
|
|
|
" [0, 1, 0],\n",
|
|
|
|
|
" [-sin(beta), 0, cos(beta)]])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"Rz = np.array([[cos(gamma), -sin(gamma), 0],\n",
|
|
|
|
|
" [sin(gamma), cos(gamma), 0],\n",
|
|
|
|
|
" [0, 0, 1]])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Combine the rotation matrices\n",
|
|
|
|
|
"R = Rz @ Ry @ Rx\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Apply the rotation to the line\n",
|
|
|
|
|
"point21 = np.column_stack((x_rotated1, y_rotated1, z_rotated1))\n",
|
|
|
|
|
"point22 = np.column_stack((x_rotated2, y_rotated2, z_rotated2))\n",
|
|
|
|
|
"point23 = np.column_stack((x_rotated3, y_rotated3, z_rotated3))\n",
|
|
|
|
|
"point24 = np.column_stack((x_rotated4, y_rotated4, z_rotated4))\n",
|
|
|
|
|
"point25 = np.column_stack((x_rotated5, y_rotated5, z_rotated5))\n",
|
|
|
|
|
"point26 = np.column_stack((x_rotated6, y_rotated6, z_rotated6))\n",
|
|
|
|
|
"point27 = np.column_stack((x_rotated7, y_rotated7, z_rotated7))\n",
|
|
|
|
|
"point28 = np.column_stack((x_rotated8, y_rotated8, z_rotated8))\n",
|
|
|
|
|
"point29 = np.column_stack((x_rotated9, y_rotated9, z_rotated9))\n",
|
|
|
|
|
"point30 = np.column_stack((x_rotated10, y_rotated10, z_rotated10))\n",
|
|
|
|
|
"point31 = np.column_stack((x_rotated11, y_rotated11, z_rotated11))\n",
|
|
|
|
|
"point32 = np.column_stack((x_rotated12, y_rotated12, z_rotated12))\n",
|
|
|
|
|
"point33 = np.column_stack((x_rotated13, y_rotated13, z_rotated13))\n",
|
|
|
|
|
"point34 = np.column_stack((x_rotated14, y_rotated14, z_rotated14))\n",
|
|
|
|
|
"point35 = np.column_stack((x_rotated15, y_rotated15, z_rotated15))\n",
|
|
|
|
|
"point36 = np.column_stack((x_rotated16, y_rotated16, z_rotated16))\n",
|
|
|
|
|
"point37 = np.column_stack((x_rotated17, y_rotated17, z_rotated17))\n",
|
|
|
|
|
"point38 = np.column_stack((x_rotated18, y_rotated18, z_rotated18))\n",
|
|
|
|
|
"point39 = np.column_stack((x_rotated19, y_rotated19, z_rotated19))\n",
|
|
|
|
|
"point40 = np.column_stack((x_rotated20, y_rotated20, z_rotated20))\n",
|
|
|
|
|
"point41 = np.column_stack((x_rotated21, y_rotated21, z_rotated21))\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"rotated_point21 = np.dot(R, point21.T).T\n",
|
|
|
|
|
"rotated_point22 = np.dot(R, point22.T).T\n",
|
|
|
|
|
"rotated_point23 = np.dot(R, point23.T).T\n",
|
|
|
|
|
"rotated_point24 = np.dot(R, point24.T).T\n",
|
|
|
|
|
"rotated_point25 = np.dot(R, point25.T).T\n",
|
|
|
|
|
"rotated_point26 = np.dot(R, point26.T).T\n",
|
|
|
|
|
"rotated_point27 = np.dot(R, point27.T).T\n",
|
|
|
|
|
"rotated_point28 = np.dot(R, point28.T).T\n",
|
|
|
|
|
"rotated_point29 = np.dot(R, point29.T).T\n",
|
|
|
|
|
"rotated_point30 = np.dot(R, point30.T).T\n",
|
|
|
|
|
"rotated_point31 = np.dot(R, point31.T).T\n",
|
|
|
|
|
"rotated_point32 = np.dot(R, point32.T).T\n",
|
|
|
|
|
"rotated_point33 = np.dot(R, point33.T).T\n",
|
|
|
|
|
"rotated_point34 = np.dot(R, point34.T).T\n",
|
|
|
|
|
"rotated_point35 = np.dot(R, point35.T).T\n",
|
|
|
|
|
"rotated_point36 = np.dot(R, point36.T).T\n",
|
|
|
|
|
"rotated_point37 = np.dot(R, point37.T).T\n",
|
|
|
|
|
"rotated_point38 = np.dot(R, point38.T).T\n",
|
|
|
|
|
"rotated_point39 = np.dot(R, point39.T).T\n",
|
|
|
|
|
"rotated_point40 = np.dot(R, point40.T).T\n",
|
|
|
|
|
"rotated_point41 = np.dot(R, point41.T).T\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Extract the rotated coordinates\n",
|
|
|
|
|
"x_rotated21, y_rotated21, z_rotated21 = rotated_point21.T\n",
|
|
|
|
|
"x_rotated22, y_rotated22, z_rotated22 = rotated_point22.T\n",
|
|
|
|
|
"x_rotated23, y_rotated23, z_rotated23 = rotated_point23.T\n",
|
|
|
|
|
"x_rotated24, y_rotated24, z_rotated24 = rotated_point24.T\n",
|
|
|
|
|
"x_rotated25, y_rotated25, z_rotated25 = rotated_point25.T\n",
|
|
|
|
|
"x_rotated26, y_rotated26, z_rotated26 = rotated_point26.T\n",
|
|
|
|
|
"x_rotated27, y_rotated27, z_rotated27 = rotated_point27.T\n",
|
|
|
|
|
"x_rotated28, y_rotated28, z_rotated28 = rotated_point28.T\n",
|
|
|
|
|
"x_rotated29, y_rotated29, z_rotated29 = rotated_point29.T\n",
|
|
|
|
|
"x_rotated30, y_rotated30, z_rotated30 = rotated_point30.T\n",
|
|
|
|
|
"x_rotated31, y_rotated31, z_rotated31 = rotated_point31.T\n",
|
|
|
|
|
"x_rotated32, y_rotated32, z_rotated32 = rotated_point32.T\n",
|
|
|
|
|
"x_rotated33, y_rotated33, z_rotated33 = rotated_point33.T\n",
|
|
|
|
|
"x_rotated34, y_rotated34, z_rotated34 = rotated_point34.T\n",
|
|
|
|
|
"x_rotated35, y_rotated35, z_rotated35 = rotated_point35.T\n",
|
|
|
|
|
"x_rotated36, y_rotated36, z_rotated36 = rotated_point36.T\n",
|
|
|
|
|
"x_rotated37, y_rotated37, z_rotated37 = rotated_point37.T\n",
|
|
|
|
|
"x_rotated38, y_rotated38, z_rotated38 = rotated_point38.T\n",
|
|
|
|
|
"x_rotated39, y_rotated39, z_rotated39 = rotated_point39.T\n",
|
|
|
|
|
"x_rotated40, y_rotated40, z_rotated40 = rotated_point40.T\n",
|
|
|
|
|
"x_rotated41, y_rotated41, z_rotated41 = rotated_point41.T\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Plot the line\n",
|
|
|
|
|
"fig = plt.figure()\n",
|
|
|
|
|
"ax = fig.add_subplot(111, projection='3d')\n",
|
|
|
|
|
"ax.plot(x_rotated21, y_rotated21, z_rotated21)\n",
|
|
|
|
|
"ax.plot(x_rotated22, y_rotated22, z_rotated22)\n",
|
|
|
|
|
"ax.plot(x_rotated23, y_rotated23, z_rotated23, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated24, y_rotated24, z_rotated24, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated25, y_rotated25, z_rotated25, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated26, y_rotated26, z_rotated26, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated27, y_rotated27, z_rotated27, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated28, y_rotated28, z_rotated28, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated29, y_rotated29, z_rotated29, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated30, y_rotated30, z_rotated30, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated31, y_rotated31, z_rotated31, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated32, y_rotated32, z_rotated32, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated33, y_rotated33, z_rotated33, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated34, y_rotated34, z_rotated34, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated35, y_rotated35, z_rotated35, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated36, y_rotated36, z_rotated36, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated37, y_rotated37, z_rotated37, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated38, y_rotated38, z_rotated38, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated39, y_rotated39, z_rotated39, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated40, y_rotated40, z_rotated40, 'k-')\n",
|
|
|
|
|
"ax.plot(x_rotated40, y_rotated40, z_rotated40, 'k-')\n",
|
|
|
|
|
"#ax.plot(x_rotated41, y_rotated41, z_rotated41)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"ax.set_xticks([])\n",
|
|
|
|
|
"ax.set_yticks([])\n",
|
|
|
|
|
"ax.set_zticks([])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"ax.set_xlabel('')\n",
|
|
|
|
|
"ax.set_ylabel('')\n",
|
|
|
|
|
"ax.set_zlabel('')\n",
|
|
|
|
|
"plt.show()"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"metadata": {
|
|
|
|
|
"kernelspec": {
|
|
|
|
|
"display_name": "Python 3 (ipykernel)",
|
|
|
|
|
"language": "python",
|
|
|
|
|
"name": "python3"
|
|
|
|
|
},
|
|
|
|
|
"language_info": {
|
|
|
|
|
"codemirror_mode": {
|
|
|
|
|
"name": "ipython",
|
|
|
|
|
"version": 3
|
|
|
|
|
},
|
|
|
|
|
"file_extension": ".py",
|
|
|
|
|
"mimetype": "text/x-python",
|
|
|
|
|
"name": "python",
|
|
|
|
|
"nbconvert_exporter": "python",
|
|
|
|
|
"pygments_lexer": "ipython3",
|
|
|
|
|
"version": "3.10.12"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"nbformat": 4,
|
|
|
|
|
"nbformat_minor": 5
|
|
|
|
|
}
|