% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/R-trajectory.R
\name{shift_point}
\alias{shift_point}
\title{Shift a point along a given direction vector}
\usage{
shift_point(P, nx, ny, offset)
}
\arguments{
\item{P}{A data frame with columns `x` and `y` representing the point to
shift. If it contains multiple rows, only the first row is used.}

\item{nx}{Numeric scalar; x-component of the direction vector.}

\item{ny}{Numeric scalar; y-component of the direction vector.}

\item{offset}{Numeric scalar; translation magnitude (in the same units as
`x`/`y`). Positive values move in the `(nx, ny)` direction; negative values
move in the opposite direction.}
}
\value{
A one-row data frame with columns `x` and `y` giving the shifted
point.
}
\description{
Translates a point `P` by an amount `offset` in the direction `(nx, ny)`.
The returned point is:
\deqn{P' = (P_x + offset \cdot nx,\; P_y + offset \cdot ny).}
}
\examples{
# Shift the point (1, 2) by 3 units in the direction (0, 1)
P <- data.frame(x = 1, y = 2)
shift_point(P, nx = 0, ny = 1, offset = 3)
}
