cross_product2d() computes the 2D cross product (also known as the
perp dot product) of two Coord2D class vectors.
The 2D cross product of vectors \((x_1, y_1)\) and \((x_2, y_2)\) is the
scalar \(x_1 y_2 - y_1 x_2\).
See also
dot_product2d() for the dot product of two Coord2D vectors.
cross_product3d() for the cross product of two Coord3D vectors.
Examples
x <- as_coord2d(2, 3)
y <- as_coord2d(5, 6)
cross_product2d(x, y)
#> [1] -3
if (getRversion() >= "4.4.0") {
crossprod(x, y)
}
#> [1] -3
