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

AVL.RescaleVector

Lengthens or shortens a vector relatively preserving its direction.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void RescaleVector
(
	AvlNet.Vector2D inVector,
	float inScale,
	bool inInverse,
	out AvlNet.Vector2D outVector
)

Parameters

Name Type Range Default Description
inVectorAvlNet.Vector2D
inScalefloat1.0fScaling factor. Default value: 1.0f.
inInverseboolSwitches to the inverse operation.
outVectorAvlNet.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

List of possible exceptions:

Error type Description
DomainError Scale cannot be zero in an inverse scaling of vector in RescaleVector.

See also