Learn R Programming

StereoMorph (version 1.6.7)

quadraticPointsOnInterval: Generates points along an interval with quadratic parameterization

Description

Generates a specified number of points on an interval, applying a quadratic function to interpoint spacing. This function is called internally by imagePlaneGridTransform.

Usage

quadraticPointsOnInterval(t1, t2, n, a)

Arguments

t1

the starting value of the returned points.

t2

the final value of the returned points.

n

the number of points.

a

a quadratic parameter describing how interpoint spacing changes over the interval.

Value

a vector of points.

Details

The parameter a describes how strong of a skew to place on the interpoint distances over the interval specified by t1 and t2. When a=0, the points are spaced uniformly across the interval. When a>0 or a<0, points become further apart or closer together along the interval, respectively, at the rate of a quadratic function (see "Examples").

See Also

imagePlaneGridTransform, resampleGridImagePoints, imagePlaneGridTransformError

Examples

Run this code
# NOT RUN {
## GENERATE EVENLY SPACED POINTS ON INTERVAL
q0 <- quadraticPointsOnInterval(t1=0, t2=1, n=10, a=0)

## MAKE POINTS PROGRESSIVELY FURTHER APART ALONG INTERVAL
qgt0 <- quadraticPointsOnInterval(t1=0, t2=1, n=10, a=1)

## MAKE POINTS PROGRESSIVELY CLOSER TOGETHER ALONG INTERVAL
qlt0 <- quadraticPointsOnInterval(t1=0, t2=1, n=10, a=-1)

## PLOT POINTS ON THREE SEPARATE LINES
plot(q0, rep(0, 10))
points(qgt0, rep(0.5, 10), col='green')
points(qlt0, rep(-0.5, 10), col='blue')
# }

Run the code above in your browser using DataLab