se3
Stellt SE(3)-Starrkörpertransformationen (Kombinationen aus Rotationen und Translationen im 3D-Raum) als DuckDB-Skalarfunktionen bereit.
Maintainer: jokasimr
Installation und Laden
INSTALL se3 FROM community;LOAD se3;Beispiel
SELECT se3_apply( quat_from_axis_angle( struct_pack(x:=0.0, y:=0.0, z:=1.0), -- rotation axis (Z) pi()/2.0 -- 90 degrees ), struct_pack(x:=1.0, y:=0.0, z:=0.0) -- point); -- returns (0., 1., 0.)Über se3
Diese Erweiterung stellt SE(3)-Starrkörpertransformationen bereit, umgesetzt als DuckDB-Skalarfunktionen.
Funktionen:
- Folgen von Rotationen und Translationen lassen sich zu einem 7-DOF-Struct kombinieren, das eine kombinierte Translation und anschließende Rotation darstellt. Siehe
se3_compose. - Transformationen können effizient auf Punkte im 3D-Raum angewendet werden, ohne trigonometrische Funktionen aufzurufen. Siehe
se3_apply().
Die vollständige Dokumentation finden Sie unter: https://github.com/jokasimr/se3.
Hinzugefügte Funktionen
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| qconj | scalar | Returns the quaternion conjugate of q. | NULL | [qconj(vvec(1.0, 2.0, 3.0, 4.0))] |
| qmul | scalar | Multiplies quaternions qA and qB. | NULL | [qmul(quat_from_axis_angle(vvec(0.0, 0.0, 1.0), pi()/2.0), quat_from_axis_angle(vvec(0.0, 1.0, 0.0), pi()/2.0))] |
| qnorm2 | scalar | Returns the squared norm of quaternion q. | NULL | [qnorm2(quat_from_axis_angle(vvec(0.0, 0.0, 1.0), pi()/2.0))] |
| quat_from_axis_angle | scalar | Constructs a unit quaternion from axis and angle in radians. Returns NULL for a zero-length axis. | NULL | [quat_from_axis_angle(vvec(0.0, 0.0, 1.0), pi()/2.0)] |
| se3_apply | scalar | Applies transformation W to point p. W can be a full transformation struct, a vec3 representing only the translation part, or a quat representing only the rotation part. | NULL | [se3_apply(se3_identity(), vvec(1.0, 2.0, 3.0))] |
| se3_compose | scalar | Composes two transformations, applying W1 first and then W2. W1 and W2 can each be a full transformation struct, a vec3 representing only the translation part, or a quat representing only the rotation part. | NULL | [se3_compose(se3_identity(), se3_identity())] |
| se3_from_axis_angle | scalar | Constructs a transform from translation t and an axis-angle rotation. Returns NULL for a zero-length axis. | NULL | [se3_from_axis_angle(vvec(1.0, 0.0, 0.0), vvec(0.0, 0.0, 1.0), pi()/2.0)] |
| se3_identity | scalar | Returns the identity transform. | NULL | [se3_identity()] |
| se3_inv | scalar | Returns the inverse transformation of W. W can be a full transformation struct, a vec3 representing only the translation part, or a quat representing only the rotation part. | NULL | [se3_inv(se3_identity())] |
| se3_make | scalar | Constructs a transform from translation t and quaternion q. | NULL | [se3_make(vvec(1.0, 2.0, 3.0), quat_from_axis_angle(vvec(0.0, 0.0, 1.0), pi()/2.0))] |
| vadd | scalar | Returns the element-wise sum of a and b. | NULL | [vadd(vvec(1.0, 2.0, 3.0), vvec(4.0, 5.0, 6.0))] |
| vangle | scalar | Returns the angle in radians between a and b. | NULL | [vangle(vvec(1.0, 0.0, 0.0), vvec(0.0, 1.0, 0.0))] |
| vcos_angle | scalar | Returns vdot(a, b) / (vnorm(a) * vnorm(b)) without clamping. | NULL | [vcos_angle(vvec(1.0, 0.0, 0.0), vvec(0.0, 1.0, 0.0))] |
| vcross | scalar | Returns the 3D cross product of a and b. | NULL | [vcross(vvec(1.0, 0.0, 0.0), vvec(0.0, 1.0, 0.0))] |
| vdot | scalar | Returns the dot product of a and b. | NULL | [vdot(vvec(1.0, 2.0, 3.0), vvec(4.0, 5.0, 6.0))] |
| vnorm | scalar | Returns the Euclidean norm of v. | NULL | [vnorm(vvec(1.0, 2.0, 3.0))] |
| vnorm2 | scalar | Returns the squared Euclidean norm of v. | NULL | [vnorm2(vvec(1.0, 2.0, 3.0))] |
| vnormalize | scalar | Returns v divided by its Euclidean norm. | NULL | [vnormalize(vvec(1.0, 2.0, 3.0))] |
| vproj | scalar | Returns the projection of a onto b. | NULL | [vproj(vvec(2.0, 2.0, 0.0), vvec(1.0, 0.0, 0.0))] |
| vrej | scalar | Returns the rejection of a from b. | NULL | [vrej(vvec(2.0, 2.0, 0.0), vvec(1.0, 0.0, 0.0))] |
| vscale | scalar | Scales vector v by scalar s. | NULL | [vscale(vvec(1.0, 2.0, 3.0), 2.0)] |
| vsub | scalar | Returns the element-wise difference a - b. | NULL | [vsub(vvec(4.0, 5.0, 6.0), vvec(1.0, 2.0, 3.0))] |
| vvec | scalar | Creates a vec3 from x, y, and z components. | NULL | [vvec(1.0, 2.0, 3.0)] |
| vvec | scalar | Creates a vec4 from w, x, y, and z components. | NULL | [vvec(1.0, 2.0, 3.0, 4.0)] |
Überladene Funktionen
Diese Erweiterung fügt keine Funktionsüberladungen hinzu.
Hinzugefügte Typen
Diese Erweiterung fügt keine Typen hinzu.
Hinzugefügte Einstellungen
Diese Erweiterung fügt keine Einstellungen hinzu.