modellingcomponents:functions
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
modellingcomponents:functions [2021/01/08 19:14] – [pocL()] oliver | modellingcomponents:functions [2021/11/09 11:22] (aktuell) – [norm()] oliver | ||
---|---|---|---|
Zeile 233: | Zeile 233: | ||
| | ||
+ | |||
+ | ==== 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 === | ||
+ | |||
+ | | ||
==== vec() ==== | ==== vec() ==== | ||
- | This named function bundles the three double arguments to a 3d vector | + | This named function bundles the three double arguments to a 3d tuple result value. Typically this in interpreted as a vector. |
Types: | Types: | ||
Zeile 290: | Zeile 304: | ||
==== norm() ==== | ==== 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() ==== | ==== 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). | 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 | + | ^ Argument ^ Type ^ Description^ |
- | | 3d vector | real | | + | ^ 1 | 3d vector | Normalize the vector. |
==== mid() ==== | ==== mid() ==== | ||
Zeile 303: | Zeile 321: | ||
Extracts the x/ | Extracts the x/ | ||
+ | |||
+ | ^ Argument ^ Type ^ Description^ | ||
+ | ^ 1 | 3d vector | extracts the x-component auf a 3d vector. | | ||
==== y() ==== | ==== y() ==== | ||
+ | |||
+ | ^ Argument ^ Type ^ Description^ | ||
+ | ^ 1 | 3d vector | extracts the y-component auf a 3d vector. | | ||
==== z() ==== | ==== z() ==== | ||
+ | |||
+ | ^ Argument ^ Type ^ Description^ | ||
+ | ^ 1 | 3d vector | extracts the z-component auf a 3d vector. | | ||
==== q() ==== | ==== q() ==== | ||
- | ===== Special | + | Create a quaternion from 4 double values. |
+ | |||
+ | ^ Argument ^ Type ^ Description ^ | ||
+ | ^ 1 | Double | x | | ||
+ | ^ 2 | Double | y | | ||
+ | ^ 3 | Double | z | | ||
+ | ^ 4 | Double | w | | ||
+ | ===== Special | ||
==== poc() ==== | ==== poc() ==== | ||
- | ^ Argument ^ Description ^ | + | Determines a point on the line defined by the first two arguments (P0 and n0) which has the shortest distance |
- | ^ 1 | Point to define | + | |
- | ^ 2 | Direction to define | + | |
- | ^ 3 | Point to define | + | |
- | ^ 4 | Direction to define | + | |
- | ==== pocL() ==== | + | ^ 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. | 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 ^ Description |
- | + | ^ 1 | Point to define a line. | VECTOR_3D | |
- | ^ Argument | + | ^ 2 | Direction to define a line. | VECTOR_3D |
- | | 3d vector | 3d vector | 3d vector | 3d vector | | + | ^ 3 | Point to start a second line perpendicular to the line defined by the first two arguments. |
- | + | ||
- | **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. | | + | |
=== Examples === | === Examples === | ||
+ | < | ||
| | ||
- | + | </ | |
- | ==== pocP() ==== | + | ==== 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 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. | + | 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. |
- | **Types: | + | ^ Argument ^ Description |
- | + | ^ 1 | Point to define a plane the point lays in.| VECTOR_3D | |
- | ^ Argument | + | ^ 2 | Normal vector |
- | | 3d vector | 3d vector | 3d vector | 3d vector | | + | ^ 3 | Point to start a line perpendicular to the plane defined by the first two arguments. |
- | + | ||
- | **Arguments: | + | |
- | + | ||
- | ^ Argument ^ Description | + | |
- | ^ 1 | Point to define a plane the point lays in.| | + | |
- | ^ 2 | Direction | + | |
- | ^ 3 | Point to start a line perpendicular to the plane defined by the first two arguments. | | + | |
+ | === Examples === | ||
+ | < | ||
+ | | ||
+ | </ | ||
==== midP() ==== | ==== midP() ==== | ||
Zeile 363: | Zeile 390: | ||
^ Argument ^ Type ^ Description ^ | ^ Argument ^ Type ^ Description ^ | ||
- | ^ 1 | Vector 3d | Point to define a the first line. | | + | ^ 1 | VECTOR_3D |
- | ^ 2 | Vector 3d | Direction to define the first line. | | + | ^ 2 | VECTOR_3D |
- | ^ 3 | Vector 3d | Point to define a the second line. | | + | ^ 3 | VECTOR_3D |
- | ^ 4 | Vector 3d | Direction to define the second line. | | + | ^ 4 | VECTOR_3D |
- | ==== pocPL() ==== | + | ==== PocPL() ==== |
- | Determines the point in the plane the arrows | + | Determines the point in the plane the arrow brakes |
**Arguments: | **Arguments: | ||
^ Argument ^ Type ^ Description ^ | ^ Argument ^ Type ^ Description ^ | ||
- | ^ 1 | Vector 3d | Point in a plane. | | + | ^ 1 | VECTOR_3D |
- | ^ 2 | Vector 3d | Normal vector of the plane. | | + | ^ 2 | VECTOR_3D |
- | ^ 3 | Vector 3d | Point to define arrow. | | + | ^ 3 | VECTOR_3D |
- | ^ 4 | Vector 3d | Direction of the arrow | | + | ^ 4 | VECTOR_3D |
+ | |||
+ | === Examples === | ||
+ | |||
+ | < | ||
+ | | ||
+ | </ | ||
===== Special functions useful for human motion analysis ===== | ===== Special functions useful for human motion analysis ===== | ||
==== chordv() ==== | ==== chordv() ==== | ||
Zeile 424: | Zeile 457: | ||
^ J | top joint position | | ^ J | top joint position | | ||
^ K | stick marker position | | ^ K | stick marker position | | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | < | ||
+ | | ||
+ | </ | ||
==== chordv2() ==== | ==== chordv2() ==== | ||
Zeile 440: | Zeile 479: | ||
^ offset | offset angle | | ^ offset | offset angle | | ||
===== Matrix manipulation functions ===== | ===== Matrix manipulation functions ===== | ||
- | |||
- | ==== mat() ==== | ||
==== matq() ==== | ==== matq() ==== | ||
+ | Create a matrix from a quaternion. | ||
+ | |||
+ | ^ Argument ^ Type ^ Description ^ | ||
+ | ^ 1 | Double | x | | ||
+ | ^ 2 | Double | y | | ||
+ | ^ 3 | Double | z | | ||
+ | ^ 4 | Double | w | | ||
+ | ==== mat() ==== | ||
==== t() ==== | ==== t() ==== | ||
==== mat4() ==== | ==== 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] | | ||
+ | |||
+ | < | ||
+ | | ||
+ | </ | ||
+ | ===== 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 === | ||
+ | |||
+ | < | ||
+ | | ||
+ | </ | ||
+ | ==== 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 === | ||
+ | |||
+ | < | ||
+ | | ||
+ | </ |
modellingcomponents/functions.txt · Zuletzt geändert: 2021/11/09 11:22 von oliver