Benutzer-Werkzeuge

Webseiten-Werkzeuge


modellingcomponents:functions

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
modellingcomponents:functions [2017/12/16 11:39] – [asin()] olivermodellingcomponents:functions [2021/11/09 11:22] (aktuell) – [norm()] oliver
Zeile 70: Zeile 70:
 ==== sqr() ==== ==== sqr() ====
 ==== sqrt() ==== ==== sqrt() ====
-==== real() ====+==== re() ====
 ==== im() ==== ==== im() ====
 ==== pow() ==== ==== pow() ====
 +
 +==== rand() ====
 ===== Trigometric ===== ===== Trigometric =====
  
 +====sin()====
 +====cos()====
 +====sinh()====
 +====cosh()====
 +====tan()====
 +====tanh()====
 ==== acos() ==== ==== acos() ====
  
Zeile 114: Zeile 122:
  
    atan(A)    atan(A)
 +   
 +==== atan2() ====
 +==== atan2'() ====
 +==== atan2''() ====
 ==== asinh() ==== ==== asinh() ====
 This named function determines the arcos sinus hyperbolicus of the given argument. This named function determines the arcos sinus hyperbolicus of the given argument.
Zeile 209: Zeile 221:
  
    length(A)    length(A)
 +==== dist() ====
 +
 +Distance between two points.
 +
 +Types:
 +
 +^ Argument 1 ^ Argument 2 ^ Result ^
 +| 3d vector | 3d vector | double |
 +
 +=== Examples ===
 +
 +   dist(A,B)
 +   
 +==== ddist() ====
 +
 +Directed distance between two points.
 +The first two arguments define the start point and the end point of a vector. The distance of the two points is calculated. The third argument defines a vector. If the vector defined by the first two points and this reference vector includes an angle less-90 or more than 90 degree than the result is negative else positive.
 +
 +Types:
 +
 +^ Argument 1 ^ Argument 2 ^ Argument 3 ^ Result ^
 +| 3d vector | 3d vector | 3d vector | double |
 +
 +=== Examples ===
 +
 +   ddist(A,B, ref)
 ==== vec() ==== ==== vec() ====
  
-This named function bundles the three double arguments to a 3d vector result value.+This named function bundles the three double arguments to a 3d tuple result value. Typically this in interpreted as a vector.
  
 Types: Types:
Zeile 233: Zeile 271:
  
    angle2(A,B,t)    angle2(A,B,t)
 +==== circc() ====
 +
 +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 |
 +
 +=== Examples ===
 +
 +    circc(A,B,C)
 +
 ==== angle() ==== ==== angle() ====
  
Zeile 254: Zeile 302:
 ^ Argument 1 ^ Argument 2 ^ Result ^ ^ Argument 1 ^ Argument 2 ^ Result ^
 | 3d vector | 3d vector | double (-1 or +1)| | 3d vector | 3d vector | double (-1 or +1)|
-===== Special =====+ 
 +==== norm() ==== 
 +Creates the normal vector of a plane based on three given points laying in the plane 
 +^ Argument ^ Type ^ Description^ 
 +^ 1 | 3d vector | first point of a plane| 
 +^ 2 | 3d vector | seconds point of a plane | 
 +^ 3 | 3d vector | third point of a plane | 
 +==== normalize() ==== 
 + 
 +If the argument is a tuple with 3 elements, it is interpreted as a vector and the result is the normalized vector (length of the vector is set to 1). 
 + 
 +^ Argument ^ Type ^ Description^ 
 +^ 1 | 3d vector | Normalize the vector. | 
 + 
 +==== mid() ==== 
 + 
 +==== x() ==== 
 + 
 +Extracts the x/first-component of a 3d-vector. 
 + 
 +^ Argument ^ Type ^ Description^ 
 +^ 1 | 3d vector | extracts the x-component auf a 3d vector. | 
 + 
 + 
 +==== y() ==== 
 + 
 +^ Argument ^ Type ^ Description^ 
 +^ 1 | 3d vector | extracts the y-component auf a 3d vector. | 
 +==== z() ==== 
 + 
 +^ Argument ^ Type ^ Description^ 
 +^ 1 | 3d vector | extracts the z-component auf a 3d vector. | 
 +==== q() ==== 
 +Create a quaternion from 4 double values. 
 + 
 +^ Argument ^ Type ^ Description ^ 
 +^ 1 | Double | x | 
 +^ 2 | Double | y | 
 +^ 3 | Double | z | 
 +^ 4 | Double | w | 
 +===== Special functions useful for 3D geometric calculations ===== 
 + 
 +==== poc() ==== 
 + 
 +Determines a point on the line defined by the first two arguments (P0 and n0) which has the shortest distance to the line defined by the third and fourth arguments (P1,n1). 
 + 
 +^ Argument ^ Description ^ Type ^ 
 +^ 1 | Point to define the first line | VECTOR_3D | 
 +^ 2 | Direction to define the first line | VECTOR_3D | 
 +^ 3 | Point to define the second line | VECTOR_3D | 
 +^ 4 | Direction to define the second line | VECTOR_3D | 
 + 
 +==== PocL() ==== 
 + 
 +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. 
 + 
 +^ Argument ^ Description ^ Type ^ 
 +^ 1 | Point to define a line. | VECTOR_3D | 
 +^ 2 | Direction to define a line. | VECTOR_3D | 
 +^ 3 | Point to start a second line perpendicular to the line defined by the first two arguments. | VECTOR_3D | 
 + 
 +=== Examples === 
 + 
 +<code> 
 +   pocL(A,B,C) 
 +</code>    
 +==== PocP() ==== 
 + 
 +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 plane. 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. 
 + 
 +^ Argument ^ Description ^ Type ^  
 +^ 1 | Point to define a plane the point lays in.| VECTOR_3D | 
 +^ 2 | Normal vector of the plane (direction perpendicular to the plane to define)| VECTOR_3D | 
 +^ 3 | Point to start a line perpendicular to the plane defined by the first two arguments. | VECTOR_3D | 
 + 
 +=== Examples === 
 + 
 +<code> 
 +   PocP(A,B,C) 
 +</code>  
 + 
 +==== midP() ==== 
 + 
 +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. | 
 + 
 +==== PocPL() ==== 
 + 
 +Determines the point in the plane the arrow brakes through the plane. 
 + 
 +**Arguments:** 
 + 
 +^ Argument ^ Type ^ Description ^ 
 +^ 1 | VECTOR_3D | Arbitrary point in a plane. | 
 +^ 2 | VECTOR_3D | Normal vector of the plane (normalization not needed). | 
 +^ 3 | VECTOR_3D | Point to define arrow. | 
 +^ 4 | VECTOR_3D | Direction of the arrow (normalization not needed). | 
 + 
 +=== Examples === 
 + 
 +<code> 
 +   pocPL(A,B,C,D) 
 +</code>  
 +===== Special functions useful for human motion analysis ===== 
 +==== chordv() ==== 
 + 
 +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 | 
 + 
 +=== Examples === 
 + 
 +<code> 
 +   chordv(70.5,I,J,K) 
 +</code>  
 +==== chordv2() ==== 
 + 
 +**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 | 
 +===== Matrix manipulation functions ===== 
 + 
 +==== matq() ==== 
 +Create a matrix from a quaternion. 
 + 
 +^ Argument ^ Type ^ Description ^ 
 +^ 1 | Double | x | 
 +^ 2 | Double | y | 
 +^ 3 | Double | z | 
 +^ 4 | Double | w | 
 +==== mat() ==== 
 + 
 +==== t() ==== 
 +==== mat4() ==== 
 + 
 +==== R() ==== 
 + 
 +Get a double component from a matrix defined by row and column index. 
 + 
 +**Arguments:** 
 + 
 +^ Argument ^ Type ^ Description ^ 
 +^ 1 | MATRIX_3X3D | Matrix to get double components from. | 
 +^ 2 | INTEGER| row [0|1|2] | 
 +^ 3 | INTEGER| column [0|1|2] | 
 + 
 +<code> 
 +   R(TCPQ,0,1,2) 
 +</code>  
 +===== Robotics functions ===== 
 +==== mdho() ==== 
 +Determines the Origin of a coordinate based on the modified Denavit-Hartenberg convention. 
 + 
 +**Arguments:** 
 + 
 +^ Argument ^ Type ^ Description ^ 
 +^ 1 | VECTOR_3D | Origin the previous coordinate system | 
 +^ 2 | VECTOR_3D | Direction of the previous joint axis | 
 +^ 3 | REAL| Displacement on the previous joint axis of the origin. Typically this is 0. | 
 +^ 4 | VECTOR_3D | Point on the joint axis where the origin should be determined | 
 +^ 5 | VECTOR_3D | Direction ofthe joint axis where the origin should be determined | 
 + 
 +=== Examples === 
 + 
 +<code> 
 +   mdhO(o1,v1,0.0,o2,v2) 
 +</code>  
 +==== dhm() ==== 
 +Determines the 4x4 Matrix of the Denavit Hartenberg convention based the DH parameters. 
 + 
 +**Arguments:** 
 + 
 +^ Argument ^ Type ^ Description ^ 
 +^ 1 | REAL| theta | 
 +^ 2 | REAL| alpha | 
 +^ 3 | REAL| d | 
 +^ 4 | REAL| r | 
 + 
 + 
 +=== Examples === 
 + 
 +<code> 
 +   dhm(theta1, alpha1, d1, r1) 
 +</code> 
modellingcomponents/functions.1513420755.txt.gz · Zuletzt geändert: 2017/12/16 11:39 von oliver

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki