# TRIM

The TRIM function smoothly interpolates between the slope m1 defined through the line segment given by x0, y0, x1, y1 and m2 defined through the line segment given by x1, y1, x2, y2.

## Format

TRIM(x, x0, y0, x1, y1, x2, y2, radius [, limit])

## Description

For values x < xI1, the function is guaranteed to return the point corresponding to x on the line through x0, y0 and x1, y1. For values x > xI2 the function is guaranteed to return the point corresponding to x on the line defined through x1, y1 and x2, y2.

For values of x in between xI1 and xI2, the function value does a smooth transition between both slopes where the derivative of TRIM with respect to x is always in between m1 and m2.

Defining limit does limit the radius with respect to the relative length of the line segments. For example, let l1 be the length of line segment 1 and l2 be the length of line segment 2, further let l be equal to the length of the smaller of those line segment. If radius is larger than limit * l, the radius will be set to limit * l.

## Arguments

x
The independent variable.
x0
The x value of a point on line segment 1.
x0 < x1 < x2.
y0
The y value of a point on line segment 1.
x1
The x value for the intersection point between line segment 1 and line segment 2.
x0 < x1 < x2
y1
The y value for the intersection point between line segment 1 and line segment 2.
x2
The x value of a point on line segment 2.
x0 < x1 < x2
y2
The y value of a point on line segment 2.
TRIM(time, 0,0, 1,1, 2, 0, .1)