My Coding >
Programming language >
Python >
Python FAQ >
Python: How to make random rotation matrix
Python: How to make random rotation matrixRandom rotation matrixThis question can be rephrased into a question, how to calculate a random rotation. This rotation should not distort proportions of an original object. Furthermore, the determinant of this matrix should be equal 1 by default. The easiest way to do it, is a make a random rotation along three orthogonal axises and multiply these matrices together. The easiest way to do in in python with numpy library. 2d rotation matrixAs I was show before 2D rotation matrix can be written as a rotation in the plane around perpendicular axis. Therefore the following two matrices will do virtually the same job
And now we can repeat this operation for three axises Python code for random rotation matrix
|
Last 10 artitles
9 popular artitles
|
|
© 2020 MyCoding.uk -My blog about coding and further learning. This blog was writen with pure Perl and front-end output was performed with TemplateToolkit. |