You are here: Start » AVL.NET » Function Reference » Geometry 2D » Geometry 2D Interpolations » AVL.LerpSegments

AVL.LerpSegments

Linearly interpolates between two segments.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void LerpSegments
(
	AvlNet.Segment2D inSegment0,
	AvlNet.Segment2D inSegment1,
	float inLambda,
	bool inIgnoreOrientation,
	out AvlNet.Segment2D outSegment
)

Parameters

Name Type Range Default Description
inSegment0AvlNet.Segment2D
inSegment1AvlNet.Segment2D
inLambdafloat<-INF, INF>0.5fInterpolation between the input segments where 0.0 value is equal to inSegment0 and 1.0 to inSegment1. Default value: 0.5f.
inIgnoreOrientationbool
outSegmentAvlNet.Segment2D

Examples

LerpSegments performed on red inSegment0 and blue inSegment1 with inLambda = 0,25. Green is the resulting outSegment.

LerpSegments performed on red inSegment0 and blue inSegment1 with inLambda = -1,0. Green is the resulting outSegment.

Remarks

Please note that:
  • interpolation begins at inSegment0,
  • for positive inLambda values interpolation is performed in the direction of inSegment1 while for negative - in the direction of a segment which is the result of the following operation: (inSegment0 - inSegment1), in example a segment consisting of inSegment1 points mirrored by the corresponding inSegment0 points.
Hence when inLambda = 0,0, outSegment is equal to inSegment0, while for inLambda = 1,0 it's the same as inSegment1 and for inLambda = -1,0 - as (inSegment0 - inSegment1). Other inLambda values interpolate between the input segments and beyond.

See also