View source: R/quadraticPointsOnInterval.R
quadraticPointsOnInterval | R Documentation |
Generates a specified number of points on an interval, applying a quadratic function to interpoint spacing. This function is called internally by imagePlaneGridTransform
.
quadraticPointsOnInterval(t1, t2, n, a)
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. |
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").
a vector of points.
Aaron Olsen
imagePlaneGridTransform
, resampleGridImagePoints
, imagePlaneGridTransformError
## 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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.