# Can a transformation matrix be expressed in terms of the vector to be transformed?

I'm currently learning linear algebra with my friend via an online course, and we have a disagreement that we would like settled.

Upon learning that vectors can be projected onto lines by a simple function, and that this function is a linear transformation, I recommended that we find a way to calculate the transformation matrix for the function.

This function was characterized by a vector $\vec{v}$ pointing along the line to be projected onto. The non-matrix form of the function we were given was this:

$$proj_{\vec{v}}(\vec{x}) = (\vec{x} \cdot \hat{u})\hat{u}$$

where $\hat{u}$ is the normalized form of $\vec{v}$ calculated by ($\frac{1}{||\vec{v}||}\vec{v}$).

When trying to construct this as a matrix, my friend came up with this (this is just for $\mathbb{R}^{3}$, but you get the idea):

$$proj_{\vec{v}}(\vec{x}) = \left[\begin{array}{ccc} \vec{x} \cdot \hat{u} & 0 & 0 \\ 0 & \vec{x} \cdot \hat{u} & 0 \\ 0 & 0 & \vec{x} \cdot \hat{u} \end{array}\right] \cdot \hat{u}$$

I see multiple problems with this. First of all, transformation matrices cannot be expressed in terms of the vector to be transformed, can they? To my understanding, they are supposed to contain constant values that are the same no matter what vector is being transformed. Second of all, linear transformations multiply $\vec{x}$ by the transformation matrix, not any other vector, right?

I'm not particularly interested in the actual transformation matrix for this problem - I plan to get some practice with what i've learned by calculating that :) - I'd just like confirmation as to whether or not the things my friend has done are valid. Thank you!

-

## 1 Answer

The short answer is: You are right. The representing matrix has to be independent of $x$. Moreover a matrix $A$ represents a linear function $f$ if and only if $Ax=f(x)$ for all $x$, so $A$ has indeed to be multiplied with the vector in question.

Even though you didn't ask for it you can write:

$$(x\cdot u)u=u(x\cdot u)=u(u\cdot x)=u(u^tx)=(uu^t)x.$$

So $uu^t$ is the representing matrix. (I write the representing matrix, since the basis is understood to be fixed. In genereal there is more than one representing matrix.)

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 13, "mathjax_display_tex": 3, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9586049914360046, "perplexity_flag": "head"}