Re: Scale a vector
- From: Peter Duniho <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Sat, 15 Sep 2007 21:06:27 -0700
Matteo Migliore wrote:
Hi!
I've to scale a vector of numbers of size N to a vector of size M.
The trasformation is like a zoom on images but I need on a vector.
I'm not really clear on the exact meaning of your description; is "N" and "M" the magnitude of the vector? Do you already know those values, or do they need to be calculated as well? How many dimensions does the vector have?
Anyway, it seems to me that if you're just doing scaling, it would be easiest to just write a simple method that does the work.
However, there is a Matrix class; if you already know M and N, and your vector is a 2-dimensional vector, you could initialize a Matrix instance with the scaling factor of M/N along the diagonal and then use the Matrix.TransformVectors() method to scale your vector.
If the above doesn't help, maybe you could be more specific.
Pete
.
- Follow-Ups:
- Re: Scale a vector
- From: Matteo Migliore
- Re: Scale a vector
- References:
- Scale a vector
- From: Matteo Migliore
- Scale a vector
- Prev by Date: Re: Problems Handling Errors Correctly
- Next by Date: Re: How to construct a string with bunch of hex numbers?
- Previous by thread: Scale a vector
- Next by thread: Re: Scale a vector
- Index(es):
Relevant Pages
|