% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/coord-methods.R
\name{dot_product}
\alias{dot_product}
\alias{dot_product1d}
\alias{dot_product2d}
\alias{dot_product3d}
\title{Compute dot (inner) products}
\usage{
dot_product1d(x, y)

dot_product2d(x, y)

dot_product3d(x, y)
}
\arguments{
\item{x}{A \link{Coord1D}, \link{Coord2D}, or \link{Coord3D} object.}

\item{y}{A \link{Coord1D}, \link{Coord2D}, or \link{Coord3D} object.}
}
\value{
A numeric vector of dot products.
}
\description{
\code{dot_product1d()}, \code{dot_product2d()}, and \code{dot_product3d()} compute the
dot (inner) product of two coordinate vectors.
You may also use the \code{*} operator and if R >= 4.3.0 you may also use the \code{\%*\%} operator to compute the dot (inner) product.
}
\examples{
p1 <- as_coord2d(x = c(1, 2), y = c(3, 4))
p2 <- as_coord2d(x = c(5, 6), y = c(7, 8))
dot_product2d(p1, p2)
p1 * p2 # equivalent
if (getRversion() >= "4.3.0") {
  p1 \%*\% p2
}
}
\seealso{
\code{\link[=cross_product3d]{cross_product3d()}} for the cross product of two \link{Coord3D} vectors.
}
