Intereting Posts

Polygonal connected path proof
prove this $\sum_{n=1}^{\infty}\arctan{\left(\dfrac{1}{n^2+1}\right)}=\arctan{\left(\tan\left(\pi\sqrt{\dfrac{\sqrt{2}-1}{2}}\right)\cdots\right)}$
Proof that the harmonic series is < $\infty$ for a special set..
Relationship between Cyclotomic and Quadratic fields
Any good decomposition theorems for total orders?
Polynomials, finite fields and cardinality/dimension considerations
Product of permutation matrices is the matrix of the composition
Assuming $AB=I$ prove $BA=I$
The modular curve X(N)
non-abelian groups of order $p^2q^2$.
How prove this integral $ \int\limits_0^1 \int\limits_0^1 \ln\Gamma(x+y^3)\,dx\,dy =-\frac 7 {16}+\frac{1}{2}\ln 2\pi$
On the meaning of being algebraically closed
Prove linear combinations of logarithms of primes over $\mathbb{Q}$ is independent
How do I calculate these sum-of-sum expressions in terms of the generalized harmonic number?
Proving a basis for inner product space V when $||e_j-v_j||< \frac{1}{\sqrt{n}}$.

I’m trying to randomly generate coordinate transformations for a fitting routine I’m writing in python. I want to rotate my data (a bunch of $(x,y,z)$ coordinates) about the origin, ideally using a bunch of randomly generated normal vectors ($(a,b,c)$ for a plane given by $ax+by+cz+d=0$). The goal is to shift each plane I’ve defined so that it lies in the {$z=0$} plane.

How do I get the right transformation matrix from my normal vector? I’m pretty sure I need to start by calculating the angle between the randomly generated normal vector and the one that corresponds to the {$z=0$} plane, $(1,1,0)$. But I have no idea what to do from there.

- Book on coordinate transformations
- Transforming from one spherical coordinate system to another
- Direct formula for area of a triangle formed by three lines, given their equations in the cartesian plane.
- If ABCD is a square with A (0,0), C (2,2). If M is the mid point of AB and P is a variable point of CB, find the smallest value of DP+PM.
- Transformations from n-sphere coordinates to cartesian coordinates.
- Vector Algebra Coordinate Transformation

- Is it possible to find function that contains every given point?
- Are two matrices having the same characteristic and minimal polynomial always similar?
- Interpolation in $SO(3)$ : different approaches
- Proof of Non-Convexity
- why determinant is volume of parallelepiped in any dimensions
- Show that a matrix $A=\pmatrix{a&b\\c&d}$ satisfies $A^2-(a+d)A+(ad-bc)I=O$
- Do $ AB $ and $ BA $ have same minimal and characteristic polynomials?
- Characterize stochastic matrices such that max singular value is less or equal one.
- another way to find inverse matrix
- large sets of commuting linearly independent matrices

As per Wouter’s answer, start by translating the plane so that it passes through the origin. Let $\mathbf n={(a,b,c)^T\over\sqrt{a^2+b^2+c^2}}$ be the unit normal to the plane. The vector ${-d\over\sqrt{a^2+b^2+c^2}}\mathbf n$ is then on the plane, so the translation amounts to subtracting this vector.

Now, you need to find a rotation that will align this plane with the $x$-$y$ plane. Following Wouter’s suggestion, we can tilt the normal so that it’s aligned with the $z$-axis. You could try to find an axis and angle of rotation that accomplish this and then apply Rodrigues’ formula, but there’s another way. Recall that the columns of a transformation matrix are the images of the basis vectors. Recalling also that the inverse of a rotation matrix is its transpose, if we find an orthonormal basis that includes $\mathbf n$, the *rows* of the rotation matrix we seek will be these basis vectors.

The unit normal $\mathbf n$ gives us one basis vector $\mathbf u_3$. Now, we need to find a pair of orthogonal vectors in the plane to complete the basis. An easy way to generate orthogonal vectors is $\mathbb R^3$ is to use the cross product. Assume that $\mathbf n$ is not aligned with the $z$-axis, otherwise we don’t need to rotate the plane. Then $\mathbf n\times(0,0,1)^T$ is a vector in the intersection of our plane and the $x$-$y$ plane that’s orthogonal to $\mathbf n$ which we then normalize to get the basis vector $\mathbf u_1$. (Were we using Rodrigues’ formula, this would be a natural choice for the rotation axis.) For the third basis vector, $\mathbf u_2=\mathbf n\times\mathbf u_1$ is in the plane that we’re rotating and is orthogonal to both of the other basis vectors. (There’s no need to normalize this product since we’re multiplying orthogonal unit vectors.) Note that we take $\mathbf n$ first in this product so that the resulting basis is right-handed. So, the rotation matrix we’re looking for is $$R=\pmatrix{—\mathbf u_1—\\—\mathbf u_2—\\—\mathbf u_3—}=\pmatrix{{n_y\over\sqrt{n_x^2+n_y^2}}&{-n_x\over\sqrt{n_x^2+n_y^2}}&0\\{n_xn_z\over\sqrt{n_x^2+n_y^2}}&{n_yn_z\over\sqrt{n_x^2+n_y^2}}&-\sqrt{n_x^2+n_y^2}\\n_x&n_y&n_z}.$$ You can verify for yourself that $R\mathbf n=(0,0,1)^T$, $R^TR=RR^T=I$ and $\det{R}=1$, so this is in fact a rotation. (You can instead take the first basis vector to be $(0,0,1)^T\times\mathbf n$, which will change a few signs in the rotation matrix.)

Rotations will not in general suffice to map the plane $ax+by+cz+d=0$ onto the plane $z=0$, you will almost always need a translation as well. So translate along the normal until you have a plane of the form $ax+by+cz=0$.

If your normal vector is not already parallel to the $z$ axis, the most natural rotation to make it parallel to the $z$ axis is a rotation around an axis in the $xy$ plane that is perpendicular to the normal. Let the normal be $\vec{v}=(a,b,c)$. We seek an axis $\vec{u}=(u_1,u_2,0)$ such that

$$\vec{v}\cdot\vec{u}=0$$

$$u_1 a+u_2 b=0$$

Once you found this axis (which is in fact the vector $\mathbf{u}_1$ from amd’s answer), you can construct a rotation matrix around this axis $\vec{u}$, and rotate by the angle between $\vec{v}$ and the $z$ axis, which will map your plane onto the $z=0$ plane.

- Intuition of Wronskian determinant and linear independence
- Cartesian product of compact sets is compact
- On the $r$-neighborhood of a set in $\mathbb{R}^2$.
- Constructing the midpoint of a segment by compass
- Some way to integrate $\sin(x^2)$?
- Contour integral – Circle instead of a square
- Proving that if $A$ is diagonalizable with non-negative eigenvalues, then $A=B^2$ for some $B$
- Simplest Example of a Poset that is not a Lattice
- Closed form: $\int_0^\pi \left( \frac{2 + 2\cos(x) -\cos((k-\frac{1}{2})x) -2\cos((k+\frac{1}{2})x) – cos((k+\frac{3}{2})x)}{1-\cos(2x)}\right)dx $
- Symmetry functions and integration
- Proving $W$ is a subspace of $P_{2}$
- Set of Linear equation has no solution or unique solution or infinite solution?
- Is every skew-adjoint matrix a commutator of two self-adjoint matrices
- Show that $f(C)$ has Hausdorff dimension at most zero.
- Can we prove directly that $M_t$ is a martingale