modellingcomponents:functions

A binlary operator which calculates the sum of two variables. The following combinations of argument types are allowed:

argument 1 | argument 2 | result |
---|---|---|

integer | integer | integer |

double | double | double |

integer | double | double |

double | integer | double |

integer | complex | complex |

double | complex | complex |

complex | complex | complex |

complex | integer | complex |

complex | double | complex |

3d vector | 3d vector | 3d vector |

3d matrix | 3d matrix | 3d matrix |

**Example**

A + B

This unary operator changes the sign of the given argument. For matrix argument the matrix inverse is determined.

Types:

Argument | Result |
---|---|

integer | integer |

double | double |

complex | complex |

3d vector | 3d vector |

3d matrix | 3d matrix |

-A

This named function calculates the absolute value of the variable give as argument.

Types:

Argument | Result |
---|---|

integer | integer |

double | double |

complex | complex |

abs(A) abs(-3)

This named function determines the acrcos tangens of the given argument.

Argument | Result |
---|---|

integer | double |

double | double |

complex | double |

acos(a)

This named function determines the arcos sinus of the given argument.

Types:

Argument | Result |
---|---|

integer | double |

double | double |

complex | double |

asin(A)

This named function determines the arcos tangens of the given argument.

Types:

Argument | Result |
---|---|

integer | double |

double | double |

complex | double |

atan(A)

This named function determines the arcos sinus hyperbolicus of the given argument.

Types:

Argument | Result |
---|---|

integer | double |

double | double |

complex | double |

asinh(A)

This named function determines the acrcos tangens hyperbolicos of the given argument.

Types:

Argument | Result |
---|---|

integer | double |

double | double |

complex | complex |

acosh(a)

This named function determines the first derivative of the arcos sinus of the given argument: 1d/(sqrt(1d-x*x))

Types:

Argument | result |
---|---|

integer | double |

double | double |

complex | double |

asin'(A)

This named function determines the second derivative of the arcos sinus of the given argument: x/pow(1-x*x, 1.5).

Types:

Argument | result |
---|---|

integer | double |

double | double |

complex | double |

asin''(A)

Determination of the dot product of two given 3d vectors.

Types:

Argument 1 | Argument 2 | Result |
---|---|---|

3d vector | 3d vector |

dot(A,B)

Determination of the length of a given 3d vector.

Types:

Argument | Result |
---|---|

3d vector | double |

length(A)

Determination of the length square of a given 3d vector.

Types:

Argument | Result |
---|---|

3d vector | double |

length(A)

Distance between two points.

Types:

Argument 1 | Argument 2 | Result |
---|---|---|

3d vector | 3d vector | double |

dist(A,B)

This named function bundles the three double arguments to a 3d vector result value.

Types:

Argument 1 | Argument 2 | Argument 3 | Result |
---|---|---|---|

double | double | double | 3d vector |

vec(x,y,z)

This named function with three arguments calculates the angle between arrows defined by the first two arguments. The third argument is used to define the sign of the resulting angle. It is interpreted as an arrow which defines the rotation direction to rotate the arrow from the first argument to the arrow of the second argument. If this results in angles more than 180 degrees a negativ angle is given instead.

Types:

Argument 1 | Argument 2 | Argument 3 | Result |
---|---|---|---|

3d vector | 3d vector | 3d vector | double |

angle2(A,B,t)

Determination of a circles mid point where all three given arguments are laying on.

Argument 1 | Argument 2 | Argument 3 | Result |
---|---|---|---|

3d vector | 3d vector | 3d vector | 3d vector |

circc(A,B,C)

This named function with two arguments calculates the so called atan2(x, y) if the arguments are of the type double. 3d vector arguments are interpreted as arrows and the angle between the two arrows are calculated.

Types:

Argument 1 | Argument 2 | Result |
---|---|---|

double | double | double |

3d vector | 3d vector | double |

angle(A,B)

If the vectors of both arguments are directed in the same half-space this named function results in a double value of -1, else +1.

Types:

Argument 1 | Argument 2 | Result |
---|---|---|

3d vector | 3d vector | double (-1 or +1) |

Extracts the x/first-component of a 3d-vector.

Point of contact straight line: The first two arguments define a straight line. The first is a point on this line and the second defines the direction of the line. A perpendicular is dropped from the point defined by the third point to this line and the result value is the point of contact in the straight line.

**Types:**

Argument 1 | Argument 2 | Argument 3 | Result |
---|---|---|---|

3d vector | 3d vector | 3d vector | 3d vector |

**Arguments:**

Argument | Description |
---|---|

1 | Point to define a line |

2 | Direction to define a line |

3 | Point to start a second line perpendicular to the line defined by the first two arguments. |

pocL(A,B,C)

Point of contact plane: The first two arguments define a plane. The first is a point in this plane and the second defines the direction of a normal to this plan. A perpendicular is dropped from the point defined by the third point to this plane and the result value is the point of contact in the plane.

**Types:**

Argument 1 | Argument 2 | Argument 3 | Result |
---|---|---|---|

3d vector | 3d vector | 3d vector | 3d vector |

**Arguments:**

Argument | Description |
---|---|

1 | Point to define a plane the point lays in. |

2 | Direction of a perpendicular to the plane to define. |

3 | Point to start a line perpendicular to the plane defined by the first two arguments. |

Determines the point with the minimum distance to two given lines.

**Arguments:**

Argument | Type | Description |
---|---|---|

1 | Vector 3d | Point to define a the first line. |

2 | Vector 3d | Direction to define the first line. |

3 | Vector 3d | Point to define a the second line. |

4 | Vector 3d | Direction to define the second line. |

Point at distance h from I in the plane IJK forming a right angle between I and J on the opposite side of IJ from K.

This function is useful in locating the center of the knee joint, from the position of the hip joint center and the position of a marker placed on the mid-thigh and lateral condyle of the knee:

- h distance in [mm] of the knee joint center to the lateral knee marker position
- I is set to the lateral knee marker position
- J to the hip joint center position,
- K to the position of the mid-thigh marker.

This is a re-implemementation of the equal named function used in Vicon clinical manager gait analysis software.

This function is used extensively in these models for defining joint centres. Three points are used to define a plane. One of these points is assumed to be a previously calculated joint centre, and a second is assumed to be a real marker, at some known, perpendicular distance (the Joint Centre Offset) from the required joint centre.

It's called a chord because by definition, the three points (two joint centres and the joint marker) lie on the periphery of a circle.

There is also a modified version of the function, which calculates the required joint centre position when the plane definition marker is rotated out of this plane by a known angle around the proposed joint centre axis.

The Knee joint centre (KJC) is calculated in the same manner in the static and dynamic model if no KAD is used.

In the dynamic model, the KJC is determined using the modified chord function, from the global position of the HJC, the thigh wand marker (THI), and the knee marker (KNE), together with the knee offset (KO), and thigh wand angle offset.

KJC is found such that the KNE marker is at a distance of KO from the KJC, in a direction perpendicular to the line from the HJC to KJC.

If a KAD is used the knee joint centre is found such that the angle between the KJC-KNE line and the KJC-THI line, projected onto a plane perpendicular to the HJC-KJC line, is the same as the thigh wand offset angle. The thigh wand offset angle is only calculated if a KAD is used.

There is only one position for the KJC that satisfies these two conditions.

Note that for static trials without a KAD, the anterior-posterior position of the KJC is determined by the position of the THI wand marker, and the value of wand offset value that is entered (if you do not enter a value, a value of zero is assumed). Correct determination of the KJC (and the AJC) is very important, especially for the kinetic calculations. In the clinic, you have to assess which method of marker positioning gives the best estimate of the KJC - using a KAD or using the THI marker.

**Types:**

Argument 1 | Argument 2 | Argument 3 | Argument 4 | Result |
---|---|---|---|---|

Real | 3d vector | 3d vector | 3d vector | 3d vector |

**Arguments:**

Argument | Description |
---|---|

h | distance in [mm] of the knee joint center to the lateral knee marker position; half joint width. |

I | Point to define a plane the point lays in, e.g. the lateral knee marker position. |

J | top joint position |

K | stick marker position |

**Types:**

Argument 1 | Argument 2 | Argument 3 | Argument 4 | Result | |
---|---|---|---|---|---|

Real | 3d vector | 3d vector | 3d vector | 3d vector | 3d vector |

**Arguments:**

Argument | Description |
---|---|

h | distance in [mm] of the knee joint center to the lateral knee marker position; half joint width. |

I | Point to define a plane the point lays in, e.g. the lateral knee marker position. |

J | top joint position |

K | stick marker position |

offset | offset angle |

modellingcomponents/functions.txt · Zuletzt geändert: 2020/04/17 17:03 von oliver