# S4 method for numeric,numeric
subHeadings(angle1, angle2, range360 = FALSE)
# S4 method for agentMatrix,numeric
subHeadings(angle1, angle2, range360 = FALSE)
# S4 method for numeric,agentMatrix
subHeadings(angle1, angle2, range360 = FALSE)
# S4 method for agentMatrix,agentMatrix
subHeadings(angle1, angle2, range360 = FALSE)
Value
Numeric. Vector of the smallest angles in degrees
by which angle1 could be rotated to produce angle2
(i.e., the target heading).
Arguments
angle1
AgentMatrix object representing the moving agents, or
Numeric. Vector of angles.
angle2
AgentMatrix object representing the moving agents, or
Numeric. Vector of angles.
range360
Logical. If range360 = TRUE, returned values are
between 0 and 360 degrees;
if range360 = FALSE, returned values are between
-180 and 180 degrees.
Default is range360 = FALSE.
Author
Sarah Bauduin
Details
This function does the opposite as the one in NetLogo where
angle1 is the target heading.
`angle1` and `angle2` must be of the same length or if different,
one of them must be of length 1.
Positive values mean clockwise rotations, negative value mean
counterclockwise rotations.
References
Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/.
Center for Connected Learning and Computer-Based Modeling,
Northwestern University. Evanston, IL.