Function angle_from_2d_vector

Function Documentation

std::vector<double> angle_from_2d_vector(const std::vector<arma::vec2> points)

Computes the angles of 2D vectors relative to the x-axis.

This function takes a vector of 2D points (arma::vec2) and calculates the angle (in radians) of each point relative to the x-axis using the arctangent function (std::atan2).

Parameters:

points – A vector of 2D points (arma::vec2).

Returns:

A vector of angles (in radians) corresponding to the input points.