sl.xyz.angle: Compute Angle Between 3D Vectors

sl.xyz.angleR Documentation

Compute Angle Between 3D Vectors

Description

Compute the angle between two 3D vectors.

Usage

sl.xyz.angle(a, b)

Arguments

a

a vector of length 3 specifying the x-y-z components of the first vector.

b

a vector of length 3 specifying the x-y-z components of the second vector.

Details

This function is based on the scalar product using the operator %*%.

Value

A scalar giving the angle between the two vectors in degrees.

Author(s)

Helge Goessling

See Also

sl.lonlat.angle

Examples

sl.xyz.angle(c(1,0,0),c(0,0,1))
## Should return:
## [1] 90

sl.xyz.angle(c(1,0,0),c(0,0,2))
## Should return:
## [1] 90

FESOM/spheRlab documentation built on April 6, 2024, 6:52 p.m.