Hi everyone.
I have a rather uncommon problem. I'm trying to fit a vector (4D vector to be precise) to specific bounds, which I determined, but with preservation of direction. Let me explain:
e.g.
- generate 10 vectors, from range [0 5] for 1st coordinate, [0 9] 2nd, [0 4] third, [0 8] 4th. All coordinates are known
- scale vectors that have coordinates outside their bounds
- leave good vectors untouched
I was trying to figure it out on 2D plane. One conclusion is that I cannot just force outgoing coordinates to their maximum boundary values - it won't preserve direction. Such a method pinns those vecotrs all to the corner of a "boundary rectangle". I could figure out some conditional rules, but it is not what im trying to accomplish. My goal is to find a procedure, such that I can quickly apply to matrix of generated vectors. And since problem is 4D it is even harder to manage a solution. Any suggestions? Maybe dealing with norms?
Thanks in advance