Back to Aurora Vision Library Lite websiteYou are here:
Start »
Geometry 2D »
Geometry 2D Spatial Transforms »
RescaleVector
Header: |
AVL.h
|
Namespace: |
avl |
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 |
|
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. |