Can't figure out this transformation matrix So basically I want to write a transformation matrix to take me out of one coordinate system and into another. 
The transformation has to be as follows:
1) The positive z axis normalized as Vector(0,0,1) has to map to an arbitrary direction vector in the new coordinate system Vector(a,b,c)
2) The origin in the original coordinate system has to map to an arbitrary position P in the new coordinate system. 
3) This might be redundant but the positive Y axis has to map to a specific direction vector(d,e,f) which is perpendicular to Vector(a,b,c) from before.
So my question is twofold: 1) How would I go about constructing this transformation matrix and 2) Is this enough data to ensure that any arbitrary vector in coordinate system 1 will be accurately transformed in coordinate system 2?

$(1)$ Request $2$ says that we are working with affine transformations, because you are mapping $O$ to another arbitrary point of $\mathbb{R}^3$. But in order to be a valid affine transformation of the form $ \overrightarrow{v}' =  A\overrightarrow{v} + b$ (b is a translation), we must have that $\det A \neq 0$. 
to define $A$, you have to figure out how it transform a basis of your space, in your case $\overrightarrow{e_1},\overrightarrow{e_2},\overrightarrow{e_3}$. (they are the normalized of axis x,y,z)
$(2)$ $A \overrightarrow{e_3}$ is fixed by request 1, the same for $\overrightarrow{e_2}$ , but you need to know something about the image of $e_1$. Just because even if you want that it,is,orthogonal to the other images of the elements of the basis you have 2 different options for $A \overrightarrow{e_1}$ (the 2 directions of a vector).
So you can't build an unique transformation with this informations. In other words if you define $A$ as your matrix, then you can define $A'$ with the property of $A' \overrightarrow{e_1} = -A\overrightarrow{e_1}$ and this will satisfy your requests. (to build $A'$ just switch the signs on the first column of $A$)
