Back to Adaptive Vision Library Lite websiteYou are here:
Start »
Geometry 2D Spatial Transforms »
RescaleVector
Lengthens or shortens a vector relatively preserving its direction.
Syntax
void avl::RescaleVector
(
const avl::Vector2D& inVector,
float inScale,
bool inInverse,
avl::Vector2D& outVector
)
Parameters
|
Name |
Type |
Default |
Description |
![](../../img/in.png) |
inVector |
const Vector2D& |
|
|
![](../../img/in.png) |
inScale |
float |
1.0f |
Scaling factor |
![](../../img/in.png) |
inInverse |
bool |
|
Switches to the inverse operation |
![](../../img/out.png) |
outVector |
Vector2D& |
|
|
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
Error type |
Description |
DomainError |
inScale cannot be zero in an inverse scaling in RescaleVector. |