Back to Aurora Vision Library website

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


Header: AVL.h
Namespace: avl
Module: FoundationLite

Lengthens or shortens a segment relatively.


void avl::RescaleSegment
	const avl::Segment2D& inSegment,
	atl::Optional<const avl::Point2D&> inReferencePoint,
	float inScale,
	bool inInverse,
	avl::Segment2D& outSegment


Name Type Default Description
Input value
inSegment const Segment2D&
Input value
inReferencePoint Optional<const Point2D&> NIL The point to which all distances change linearly (the mass center by default)
Input value
inScale float 1.0f Scaling factor (negative values invert the segment)
Input value
inInverse bool Switches to the inverse operation
Output value
outSegment Segment2D&

In-place Processing

This function supports in-place data processing - you can pass the same reference to inSegment and outSegment

Read more about In-place Computation.


RescaleSegment performed on the sample segment, inReferencePoint = auto, inScale = 2.0 and inInverse = false.


List of possible exceptions:

Error type Description
DomainError Scale cannot be zero in an inverse rescaling of a segment in RescaleSegment.