User Tools

Site Tools


visual3d:documentation:pipeline:model_based_data_commands:angular_momentum_example

This is an old revision of the document!


Angular Momentum Examples

This page demonstrates how to compute angular momentum using sports data sets, with normalization methods based on recent biomechanics research. The approach follows principles established in studies like “How maximal whole-body and segmental angular momenta relate to fastball speeds in high school baseball pitchers,” which showed that normalized angular momentum (divided by body mass × height × velocity) provides meaningful comparisons across athletes of different sizes. The pipeline computes both segmental angular momentum (with local and remote components) and model angular momentum, then projects these 3D vectors onto task-specific planes—such as the swing plane in batting or a golf swing. This projection isolates the rotational momentum that actually contributes to performance, filtering out off-axis rotation that doesn't transfer energy to the implement or ball. The examples below show how to implement these calculations in Visual3D for batting analysis, though the same principles apply to pitching, throwing, and other rotational sports movements.

Baseball

This example shows how to compute the angular momentum of the model (MODEL_ANGULAR_MOMENTUM) as well as finding the angular momentum of a segment (ANGULAR_MOMENTUM) using babseball data with accounting for the swing plane.


1. Below outlines the creation of the event sequence that occurs during the contact sequence (when the ball is being contacted by the bat).

Event_Explicit
/EVENT_NAME=START
/FRAME= ! Frame # when the bat makes contact with the ball !
! /TIME=
;

Event_Explicit
/EVENT_NAME=END
/FRAME= ! Frame # when the ball leaves the bat !
! /TIME=
;

Event_Define_Event_Sequence
/EVENT_SEQUENCE_NAME=CONTACT_PLANE
/EVENT_SEQUENCE=START+END
! /EXCLUDE_EVENTS=
! /INSIDE_OF_SEQUENCE=
! /OFFSET_FROM_START=
! /OFFSET_FROM_END=
! /OFFSET_BY=PERCENT
/EVENT_SEQUENCE_INSTANCE=0
;

2. The pipeline's Best_Fit_Plane calculation creates a plane based on the bat's actual path during the contact sequence (CONTACT_PLANE). This represents the true swing plane for that specific swing. This is done since this calculates only the angular momentum that is contributing to the bat speed in the actual swing direction (within the swing plane).

Evaluate_Expression
/EXPRESSION=METRIC_MEAN(SIGN(DOT(VECTOR(0,0,1,0),Best_Fit_Plane(CURRENT_SIGNAL,EVENT_LABEL::SEQUENCE::CONTACT_PLANE))))
*Best_Fit_Plane(CURRENT_SIGNAL,EVENT_LABEL::SEQUENCE::CONTACT_PLANE)
/SIGNAL_TYPES=LANDMARK
! /SIGNAL_FOLDER=ORIGINAL
/SIGNAL_NAMES=BAT_DISTAL
! /SIGNAL_COMPONENTS=
! /RESULT_TYPES=DERIVED
/RESULT_FOLDERS=BAT
/RESULT_NAME=CONTACT_PLANE
! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
;

3. The following model based items that are being computed is the angular momentum, of both segments as well as the entire model.

!! Segment angular momentum: thorax angular momentum including the thorax's linear momentum relative to the body’s center of mass (COM) !!
Compute_Model_Based_Data
/RESULT_NAME=Thorax_AngMom_Remote
/SUBJECT_TAG=ALL_SUBJECTS
/FUNCTION=ANGULAR_MOMENTUM
/SEGMENT=RTX
/REFERENCE_SEGMENT=
! /RESOLUTION_COORDINATE_SYSTEM=LAB
! /USE_CARDAN_SEQUENCE=FALSE
/NORMALIZATION=TRUE
/NORMALIZATION_METHOD=DEFAULT_NORMALIZATION
! /NORMALIZATION_METRIC=
! /NEGATEX=FALSE
! /NEGATEY=FALSE
! /NEGATEZ=FALSE
! /AXIS1=X
! /AXIS2=Y
! /AXIS3=Z
/INCLUDE_REMOTE_ANGULAR_MOMENTUM=TRUE
! /TREADMILL_DATA=FALSE
! /TREADMILL_DIRECTION=UNIT_VECTOR(0,1,0)
! /TREADMILL_SPEED=0.0
;

!! Segment angular momentum: right forearm angular momentum including the forearm's linear momentum relative to the body’s center of mass (COM) !!
Compute_Model_Based_Data
/RESULT_NAME=RFA_AngMomRemote
/SUBJECT_TAG=ALL_SUBJECTS
/FUNCTION=ANGULAR_MOMENTUM
/SEGMENT=RFA
/REFERENCE_SEGMENT=
! /RESOLUTION_COORDINATE_SYSTEM=LAB
! /USE_CARDAN_SEQUENCE=FALSE
/NORMALIZATION=TRUE
/NORMALIZATION_METHOD=DEFAULT_NORMALIZATION
! /NORMALIZATION_METRIC=
! /NEGATEX=FALSE
! /NEGATEY=FALSE
! /NEGATEZ=FALSE
! /AXIS1=X
! /AXIS2=Y
! /AXIS3=Z
/INCLUDE_REMOTE_ANGULAR_MOMENTUM=TRUE
! /TREADMILL_DATA=FALSE
! /TREADMILL_DIRECTION=UNIT_VECTOR(0,1,0)
! /TREADMILL_SPEED=0.0
;

!! Model angular momentum: Total body's angular momentum!!
Compute_Model_Based_Data
/RESULT_NAME=AngMomTotal
/SUBJECT_TAG=ALL_SUBJECTS
/FUNCTION=MODEL_ANGULAR_MOMENTUM
/SEGMENT=
/REFERENCE_SEGMENT=
! /RESOLUTION_COORDINATE_SYSTEM=LAB
! /USE_CARDAN_SEQUENCE=FALSE
! /NORMALIZATION=FALSE
! /NORMALIZATION_METHOD=
! /NORMALIZATION_METRIC=
! /NEGATEX=FALSE
! /NEGATEY=FALSE
! /NEGATEZ=FALSE
! /AXIS1=X
! /AXIS2=Y
! /AXIS3=Z
! /INCLUDE_REMOTE_ANGULAR_MOMENTUM=FALSE
! /TREADMILL_DATA=FALSE
! /TREADMILL_DIRECTION=UNIT_VECTOR(0,1,0)
! /TREADMILL_SPEED=0.0
;

4. Using the CONTACT_PLANE calculated in step 2, the projection values below represent the magnitude of angular momentum aligned with the swing plane, expressed as a scalar rather then a vector.

Evaluate_Expression
/EXPRESSION=DOT(DERIVED::BAT::CONTACT_PLANE,VECTOR(CURRENT_SIGNAL,0))
/SIGNAL_TYPES=LINK_MODEL_BASED
! /SIGNAL_FOLDER=ORIGINAL
/SIGNAL_NAMES=AngMomTotal
! /SIGNAL_COMPONENTS=
! /RESULT_TYPES=DERIVED
 /RESULT_FOLDERS=BAT
 /RESULT_NAME=_PROJ
 /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
;

Evaluate_Expression
/EXPRESSION=DOT(DERIVED::BAT::CONTACT_PLANE,VECTOR(CURRENT_SIGNAL,0))
/SIGNAL_TYPES=LINK_MODEL_BASED
! /SIGNAL_FOLDER=ORIGINAL
/SIGNAL_NAMES=Thorax_AngMomRemote
! /SIGNAL_COMPONENTS=
! /RESULT_TYPES=DERIVED
/RESULT_FOLDERS=BAT
/RESULT_NAME=_PROJ
/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
;

Evaluate_Expression
/EXPRESSION=DOT(DERIVED::BAT::CONTACT_PLANE,VECTOR(CURRENT_SIGNAL,0))
/SIGNAL_TYPES=LINK_MODEL_BASED
! /SIGNAL_FOLDER=ORIGINAL
/SIGNAL_NAMES=RFA_AngMomRemote
! /SIGNAL_COMPONENTS=
! /RESULT_TYPES=DERIVED
/RESULT_FOLDERS=BAT
/RESULT_NAME=_PROJ
/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
;

Golf

Segment Angular Momentum About Segment COM

Compute_Model_Based_Data
/RESULT_NAME=Angular_Segment_Momentum
/SUBJECT_TAG=ALL_SUBJECTS
/FUNCTION=ANGULAR_MOMENTUM
/SEGMENT=RFA
/REFERENCE_SEGMENT=
! /RESOLUTION_COORDINATE_SYSTEM=LAB
! /USE_CARDAN_SEQUENCE=FALSE
/NORMALIZATION=TRUE
/NORMALIZATION_METHOD=DEFAULT_NORMALIZATION
! /NORMALIZATION_METRIC=
! /NEGATEX=FALSE
! /NEGATEY=FALSE
! /NEGATEZ=FALSE
! /AXIS1=X
! /AXIS2=Y
! /AXIS3=Z
/INCLUDE_REMOTE_ANGULAR_MOMENTUM=TRUE
! /TREADMILL_DATA=FALSE
! /TREADMILL_DIRECTION=UNIT_VECTOR(0,1,0)
! /TREADMILL_SPEED=0.0

Segment Angular Momentum About Model COM

First_Derivative
/SIGNAL_TYPES=KINETIC_KINEMATIC
/SIGNAL_FOLDER=Model
/SIGNAL_NAMES=CenterOfMass
/RESULT_TYPES=DERIVED
/RESULT_FOLDER=COM
! /RESULT_NAMES=
/RESULT_SUFFIX=_VEL
;

! Nested Loops
! Outer Loop gets an active segment


For_Each
/ITERATION_PARAMETER_NAME=SEG_NAME
/ITEMS=RFT+RSK+RTH+LFT+LSK+LTH+RPV
;

! compute the R for (r x mv)
Evaluate_Expression
/EXPRESSION=vector((Kinetic_Kinematic::&::SEG_NAME&:&:CGPos::X - KINETIC_KINEMATIC::MODEL::CenterOfMass::X ), (Kinetic_Kinematic::&::SEG_NAME&:&:CGPos::Y - KINETIC_KINEMATIC::MODEL::CenterOfMass::Y), (Kinetic_Kinematic::&::SEG_NAME&:&:CGPos::Z - KINETIC_KINEMATIC::MODEL::CenterOfMass::Z))
/RESULT_NAME=::SEG_NAME&_R 
! /RESULT_TYPE=DERIVED
! /RESULT_FOLDER=PROCESSED
;

! compute mv
Evaluate_Expression
/EXPRESSION=(MODEL::SEGMENT::&::SEG_NAME&:&:MASS)*(Kinetic_Kinematic::&::SEG_NAME&:&:CGVel - DERIVED::COM::CENTEROFMASS_VEL)
/RESULT_NAME=::SEG_NAME&_mv
! /RESULT_TYPE=DERIVED
! /RESULT_FOLDER=PROCESSED
;

! compute rxmv
Evaluate_Expression
/EXPRESSION=cross(DERIVED::PROCESSED::&::SEG_NAME&_R, DERIVED::PROCESSED::&::SEG_NAME&_mv)
/RESULT_NAME=::SEG_NAME&_rxmv
! /RESULT_TYPE=DERIVED
! /RESULT_FOLDER=PROCESSED
;

Compute_Model_Based_Data
/RESULT_NAME=::SEG_NAME&_IW
/FUNCTION=ANGULAR_MOMENTUM
/SEGMENT=::SEG_NAME
/REFERENCE_SEGMENT=LAB
! /RESOLUTION_COORDINATE_SYSTEM=LAB
! /USE_CARDAN_SEQUENCE=FALSE
! /NORMALIZATION=FALSE
! /NORMALIZATION_METHOD=
! /NORMALIZATION_METRIC=
! /NEGATEX=FALSE
! /NEGATEY=FALSE
! /NEGATEZ=FALSE
! /AXIS1=X
! /AXIS2=Y
! /AXIS3=Z
;

! compute rxmv
Evaluate_Expression
/EXPRESSION=LINK_MODEL_BASED::ORIGINAL::&::SEG_NAME&_IW + DERIVED::PROCESSED::&::SEG_NAME&_rxmv
/RESULT_NAME=::SEG_NAME&_IW
/RESULT_TYPE=DERIVED
/RESULT_FOLDER=Momentum_Contribution
;

End_For_Each
/ITERATION_PARAMETER_NAME=SEG_NAME
;

Whole Body Angular Momentum About Model COM

visual3d/documentation/pipeline/model_based_data_commands/angular_momentum_example.1766155418.txt.gz · Last modified: by wikisysop