Learn R Programming

pathviewr (version 1.1.8)

get_2d_angle: Compute an angle in 2D space

Description

Compute an angle in 2D space

Usage

get_2d_angle(x1, y1, x2, y2, x3, y3)

Value

A numeric vector that provides the angular measurement in degrees.

Arguments

x1

x-coordinate of first point

y1

y-coordinate of first point

x2

x-coordinate of second point (vertex)

y2

y-coordinate of second point (vertex)

x3

x-coordinate of third point

y3

y-coordinate of third point

Author

Vikram B. Baliga

Details

Everything supplied to arguments must be numeric values or vectors of numeric values. The second point (x2, y2) is treated as the vertex, and the angle between the three points in 2D space is computed.

See Also

Other mathematical functions: calc_min_dist_v(), deg_2_rad(), find_curve_elbow(), get_3d_angle(), get_3d_cross_prod(), get_dist_point_line(), get_traj_velocities(), get_velocity(), rad_2_deg()

Examples

Run this code
get_2d_angle(
  0, 1,
  0, 0,
  1, 0)

Run the code above in your browser using DataLab