User Tools

Site Tools


visual3d:documentation:pipeline:expressions:array_and_matrix_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
visual3d:documentation:pipeline:expressions:array_and_matrix_functions [2024/06/19 12:49] sgrangervisual3d:documentation:pipeline:expressions:array_and_matrix_functions [2025/06/20 13:38] (current) – [Pose_4x4] wikisysop
Line 1: Line 1:
-===== arrays =====+====== Array and Matrix Functions ======
  
-==== vector ====+These array and matrix functions can be used anywhere Visual3D allows [[visual3d:documentation:pipeline:expressions:expressions_overview|expressions]] to be used.
  
-**vector**(a,b, etc)+===== Arrays =====
  
-creates a vector of the number of components specified+Arrays can be thought of as a 1-dimensional ordered list of numerical values.
  
-! create a metric signal with 2 components and one frame +==== Vector ====
-[metric_explicit] +
-! /result_metric_folder=processed +
-/result_metric_name=vec2 +
-/metric_value=2+3 +
-**;** +
-! create a vector containing a constant, a two dimensional metric and a 3 dimensional model based signal. +
-**evaluate_expression** +
-/expression=vector (1, metric::processed::vec2, link_model_based::original::rknee_angle) +
-! /signal_types= +
-! /signal_folder=original +
-! /signal_names= +
-! /result_types=derived +
-! /result_folders=processed +
-/result_name=test +
-! /apply_as_suffix_to_signal_name=false +
-**;** +
-the resulting signal will have the first three columns (one for the constant, one for the vector of 2 components) buffered to the number of frames of rknee_angle by replicating the first frame. +
-==== list ====+
  
-**list(a,b,etc)** -- creates a list (column vectorof the number of rows specified+**Vector**(a,b, etc) - creates a vector of the number of components specified
-==== unit_vector ====+
  
-**unit_vector (a, b, etc)** -- creates a unit vector of the number of components specified: +<code> 
-===== rotation matrices =====+! Create metric signal with 2 components and one frame 
 +Metric_Explicit 
 +! /RESULT_METRIC_FOLDER=PROCESSED 
 +/RESULT_METRIC_NAME=VEC2 
 +/METRIC_VALUE=2+3 
 +;
  
-==== rotation multiply ====+! Create a vector containing a constant, a two dimensional metric and a 3 dimensional model based signal. 
 +Evaluate_Expression 
 +/EXPRESSION=vector (1, METRIC::PROCESSED::VEC2, LINK_MODEL_BASED::ORIGINAL::RKNEE_ANGLE) 
 +! /SIGNAL_TYPES= 
 +! /SIGNAL_FOLDER=ORIGINAL 
 +! /SIGNAL_NAMES= 
 +! /RESULT_TYPES=DERIVED 
 +! /RESULT_FOLDERS=PROCESSED 
 +/RESULT_NAME=TEST 
 +! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE 
 +
 +</code>
  
-**rotation_multiply**(a,b)+The resulting signal will have the first three columns (one for the constantone for the vector of 2 componentsbuffered to the number of frames of RKNEE_ANGLE by replicating the first frame.
  
-example: multiply two rotation signals +==== List ====
-**evaluate_expression** +
-/expression=rotation_multiply(rotation_inverse(rotation::original::pelvis_shifted_4x4),current_signal) +
-/signal_types=rotation +
-! /signal_folder=original +
-! /signal_names= +
-/result_types=rotation +
-! /result_folders=processed +
-/result_name=**_mult** +
-/apply_as_suffix_to_signal_name=true +
-**;** +
-==== rotation inverse ====+
  
-**rotation_inverse**(a)+**list(a,b,etc)** - creates list (column vectorof the number of rows specified.
  
-example: inverse of a 4x4 rotation signal or a 3x3 link_model_based rotation +==== Unit_Vector ====
-a good description of the inverse of a rotation signals can be found [[[http://www.info.hiroshima-cu.ac.jp/~miyazaki/knowledge/teche0053.html|here]]] +
-**evaluate_expression** +
-/expression=rotation_inverse(rotation::original::pelvis_shifted_4x4) +
-/signal_types=rotation +
-! /signal_folder=original +
-! /signal_names= +
-/result_types=rotation +
-! /result_folders=processed +
-/result_name=**_inv** +
-/apply_as_suffix_to_signal_name=true +
-**;** +
-\\+
  
 +**unit_vector (a, b, etc)** - creates a unit vector of the number of components specified.
  
-==== rotation transpose ====+===== Rotation Matrices =====
  
-**rotation_transpose**(a)+Rotation matrices are used throughout Visual3D because they can entirely contain the information regarding segment's [[visual3d:documentation:kinematics_and_kinetics:pose_estimation|pose]].
  
-example: transpose of a 3x3 link_model_based rotation signal +==== Rotation Multiply ====
-**evaluate_expression** +
-/expression=rotation_transpose(rotation::original::pelvis_shifted_4x4) +
-/signal_types=rotation +
-! /signal_folder=original +
-! /signal_names= +
-/result_types=rotation +
-! /result_folders=processed +
-/result_name=**_t** +
-/apply_as_suffix_to_signal_name=true +
-**;** +
-==== pose_euler2rotation4x4 ====+
  
-this was created for the shadow segments introduced in 2024. +**Rotation_Multiply**(a,b- Multiplies two rotation matrices
-create 4x4 rotation from the visual3d pose of a segmentwith the translation of the origin represented in any coordinate system, and the orientation defined by euler angles and the euler sequence. +
-pose_euler2rotation4x4(r_heel,0,0,0,123)+
  
 +Example: Multiply two ROTATION signals
 +<code>
 +Evaluate_Expression
 +/EXPRESSION=ROTATION_MULTIPLY(ROTATION_INVERSE(ROTATION::ORIGINAL::PELVIS_SHIFTED_4x4),CURRENT_SIGNAL)
 +/SIGNAL_TYPES=ROTATION
 +! /SIGNAL_FOLDER=ORIGINAL
 +! /SIGNAL_NAMES=
 +/RESULT_TYPES=ROTATION
 +! /RESULT_FOLDERS=PROCESSED
 +/RESULT_NAME=_MULT
 +/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
 +;
 +</code>
  
 +==== Rotation Inverse ====
 +
 +**Rotation_Inverse**(a) - Calculates the inverse of a rotation matrix
 +
 +Example: Inverse of a 4x4 ROTATION signal or a 3x3 LINK_MODEL_BASED ROTATION
 +
 +<code>
 +Evaluate_Expression
 +/EXPRESSION=ROTATION_INVERSE(ROTATION::ORIGINAL::PELVIS_SHIFTED_4x4)
 +/SIGNAL_TYPES=ROTATION
 +! /SIGNAL_FOLDER=ORIGINAL
 +! /SIGNAL_NAMES=
 +/RESULT_TYPES=ROTATION
 +! /RESULT_FOLDERS=PROCESSED
 +/RESULT_NAME=_INV
 +/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
 +;
 +</code>
 +
 +**Note**: A good description of the inverse of a ROTATION signals can be found [[http://www.info.hiroshima-cu.ac.jp/~miyazaki/knowledge/teche0053.html|here]]
 +
 +==== Rotation Transpose ====
 +
 +**Rotation_Transpose**(a) - Creates the transposition of a rotation matrix.
 +
 +Example: Transpose of a 3x3 LINK_MODEL_BASED ROTATION signal
 +<code>
 +Evaluate_Expression
 +/EXPRESSION=ROTATION_TRANSPOSE(ROTATION::ORIGINAL::PELVIS_SHIFTED_4x4)
 +/SIGNAL_TYPES=ROTATION
 +! /SIGNAL_FOLDER=ORIGINAL
 +! /SIGNAL_NAMES=
 +/RESULT_TYPES=ROTATION
 +! /RESULT_FOLDERS=PROCESSED
 +/RESULT_NAME=_T
 +/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
 +;
 +</code>
 +
 +==== Pose_4x4 ====
 +
 +**Pose_4x4(a,0,0,0,123)** - Creates a 4x4 rotation signal based on signal "a" with the translation of the origin (0,0,0) and the orientation defined by Euler angles with the Euler sequence 123.
 +
 +This function was created in support of the [[visual3d:documentation:modeling:segments:segment_overview#shadow_segments|shadow segments]] feature.
 +
 +Example: Create a rotation matrix for a shadow segment of the right heel
 +<code>
 +POSE_4X4(R_HEEL,0,0,0,123)
 +</code>
 +
 +===== See Also =====
 +
 +Go back to see other [[visual3d:documentation:pipeline:expressions:expressions_overview#functions|Expression functions]].
visual3d/documentation/pipeline/expressions/array_and_matrix_functions.1718801391.txt.gz · Last modified: 2024/06/19 12:49 by sgranger