Back to FabImage Library Lite websiteYou are here:
Start »
Geometry 2D »
Geometry 2D Spatial Transforms »
RescaleVector
Header: |
FIL.h
|
Namespace: |
fil |
Lengthens or shortens a vector relatively preserving its direction.
Syntax
void fil::RescaleVector
(
const fil::Vector2D& inVector,
float inScale,
bool inInverse,
fil::Vector2D& outVector
)
Parameters
|
Name |
Type |
Default |
Description |
 |
inVector |
const Vector2D& |
|
|
 |
inScale |
float |
1.0f |
Scaling factor |
 |
inInverse |
bool |
|
Switches to the inverse operation |
 |
outVector |
Vector2D& |
|
|
In-place Processing
This function supports in-place data processing - you can pass the same reference to inVector and outVector
Read more about In-place Computation.
Examples
RescaleVector performed on a vector (red one) with DeltaX = 0, DeltaY = 10 with parameters inScale = 5, inInverse = True. outVector returns vector (blue one)
Errors
List of possible exceptions:
Error type |
Description |
DomainError |
Scale cannot be zero in an inverse scaling of vector in RescaleVector. |