I have a line $l$ starting at origin ending at 0,0,1 along the $z$ axis. $l$ is rotated $P$ degrees around the $x$-axis and then $Q$ degrees around the $y$-axis. So I have a new endpoint for the line.
Now I have lot of points that I am projecting onto this line but what I am wondering is, can I just use the information about the line i.e. $P$ & $Q$ and precompute a (transformation/projection) matrix. And simply multiply each point with this matrix such that I get it's projection on the line.