Back to Aurora Vision Library website

You are here: Start » Function Reference » Geometry 2D » Geometry 2D Spatial Transforms » RescaleVector

RescaleVector


Header: AVL.h
Namespace: avl
Module: FoundationLite

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
)

Parameters

Name Type Default Description
Input value inVector const Vector2D&
Input value inScale float 1.0f Scaling factor
Input value inInverse bool Switches to the inverse operation
Output value 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.