Back to Adaptive Vision Library websiteYou are here:
Start »
Function Reference »
Geometry 2D Spatial Transforms »
RescaleVector
Lengthens or shortens a vector relatively preserving its direction.
Syntax
C++
C#
void avl::RescaleVector
(
const avl::Vector2D& inVector,
float inScale,
bool inInverse,
avl::Vector2D& outVector
)
void RescaleVector
(
Vector2D inVector,
float inScale,
bool inInverse,
out 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& |
|
|
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. |