TrajScale | R Documentation |
Scales the cartesian coordinates in a trajectory, for example, to convert units from pixels to metres.
TrajScale(trj, scale, units, yScale = scale)
trj |
The trajectory to be scaled. |
scale |
Scaling factor to be applied to the trajectory coordinates. |
units |
Character specifying the spatial units after scaling, e.g. "m" or "metres" |
yScale |
Optional scaling factor to be applied to the y-axis, which may
be specified if the original coordinates are not square. Defaults to
|
new scaled trajectory.
set.seed(42)
trj <- TrajGenerate()
# original trajectory units are pixels, measured as having
# 47 pixels in 10 mm, so to convert to metres, scale the
# trajectory by the approriate factor, i.e. (size in metres) / (size in pixels).
scale <- .01 / 47
scaled <- TrajScale(trj, scale, "m")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.