Turns and Angular Analysis¶
Turns¶
Turns can be calculated using calc_angle()
.
- traja.trajectory.calc_angle(trj: TrajaDataFrame, unit: str = 'degrees', lag: int = 1)[source]¶
Returns a
Series
with angle between steps as a function of displacement with regard to x axis.- Parameters
- Returns
Angle series.
- Return type
angle (
pandas.Series
)
Heading¶
Heading can be calculated using calc_heading()
.
- traja.trajectory.calc_heading(trj: TrajaDataFrame)[source]¶
Calculate trajectory heading.
- Parameters
trj (
TrajaDataFrame
) – Trajectory- Returns
heading as a
Series
- Return type
heading (
pandas.Series
)
..doctest:
>>> df = traja.TrajaDataFrame({'x':[0,1,2],'y':[1,2,3]}) >>> traja.calc_heading(df) 0 NaN 1 45.0 2 45.0 Name: heading, dtype: float64
Angles¶
Angles can be calculated using angles()
.