Back to Adaptive 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.
Syntax
C++
C#
void avl::RescaleSegment ( const avl::Segment2D& inSegment, atl::Optional<const avl::Point2D&> inReferencePoint, float inScale, bool inInverse, avl::Segment2D& outSegment )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inSegment | const Segment2D& | |||
inReferencePoint | Optional<const Point2D&> | NIL | The point to which all distances change linearly (the mass center by default) | |
inScale | float | 1.0f | Scaling factor (negative values invert the segment) | |
inInverse | bool | Switches to the inverse operation | ||
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.
Examples
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Scale cannot be zero in an inverse rescaling of a segment in RescaleSegment. |