Calculate 2D angle positive z-axis and a line from reference to target position in degrees

calculate_2d_angle_deg(target_x, target_z, ref_x = 0, ref_z = 0)

Arguments

target_x

Vector of target x positions

target_z

Vector of target y positions

ref_x

Vector of reference x positions (default: origin)

ref_z

Vector of reference y positions (default: origin)

Value

Angle between a line from reference to target vector and positive z-axis, measured clockwise and in [-180, 180]