Re: Scale a vector



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
.



Relevant Pages

  • Re: graphs and scale factor
    ... My questions regarding the curve fitting to images using the hold method have got much things to do with the scaling issue I realize. ... I'd like to be able to turn it off/on, and also adjust the scale factor to something else. ... supplying your own formatted text strings for the YLabel turns off the ...
    (comp.soft-sys.matlab)
  • Re: Scale a vector
    ... 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. ... However, there is a Matrix class; if you already know M and N, and ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: 120dpi setting for windows and dynamic added controls
    ... The scaling example is fine. ... dependent on the Windows default font used for the UI, ... This method calculated the relative scale sizes from ... user controls would scale correctly ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: OT: Digital SLRs
    ... The official photog with his large format film jobby ... don't quite reach the ends of the scale. ... With RAW images it helps a lot to slightly underexpose anyway - I ...
    (uk.comp.sys.mac)
  • Re: OT: Digital SLRs
    ... The official photog with his large format film jobby ... don't quite reach the ends of the scale. ... With RAW images it helps a lot to slightly underexpose anyway - I ...
    (uk.comp.sys.mac)