You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 2, 2024. It is now read-only.
`public explicit `[`direction`](#structkln_1_1direction_1a42ce139ace571176acabbce21d6c64b2)`(float * data) noexcept` | Data should point to four floats with memory layout `(0.f, x, y, z)` where the zero occupies the lowest address in memory.
Copy file name to clipboardExpand all lines: docs/api/kln_entity.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ To compute PGA elements using SSE, we partition the basis into four partitions c
9
9
```cpp
10
10
LSB --> MSB
11
11
p0: (e_0, e_1, e_2, e_3)
12
-
p1: (1, e_12, e_31, e_23)
12
+
p1: (1, e_23, e_31, e_12)
13
13
p2: (e_0123, e_01, e_02, e_03)
14
-
p3: (e_123, e_021, e_013, e_032)
14
+
p3: (e_123, e_032, e_013, e_021)
15
15
```
16
16
17
17
The scalar and pseudoscalar are packed in partitions $p_1$ and $p_2$ along with the 6 bivector elements. The scheme groups, for the most part, elements of similar grade and the presence of the degenerate generator. When non-uniformity exists within a partition (mixed degenerate and non-degenerate components, or mixed grade), the "exception" is housed in the first component so that the same swizzle masks can be used.
Copy file name to clipboardExpand all lines: docs/api/kln_line.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ struct kln::line
26
26
27
27
A line is specifed by 6 coordinates which correspond to the line's [Plücker coordinates](https://en.wikipedia.org/wiki/Pl%C3%BCcker_coordinates). The coordinates specified in this way correspond to the following multivector:
`public `[`motor`](#structkln_1_1motor_1a0fc9829b8e6323e3ae2cc583361ce3d5)`(float a,float b,float c,float d,float e,float f,float g,float h) noexcept` | Direct initialization from components. A more common way of creating a motor is to take a product between a rotor and a translator. The arguments coorespond to the multivector $a + b\mathbf{e}_{12} + c\mathbf{e}_{31} + d\mathbf{e}_{23} +\ e\mathbf{e}_{01} + f\mathbf{e}_{02} + g\mathbf{e}_{03} +\ h\mathbf{e}_{0123}$
53
+
`public `[`motor`](#structkln_1_1motor_1a0fc9829b8e6323e3ae2cc583361ce3d5)`(float a,float b,float c,float d,float e,float f,float g,float h) noexcept` | Direct initialization from components. A more common way of creating a motor is to take a product between a rotor and a translator. The arguments coorespond to the multivector $a + b\mathbf{e}_{23} + c\mathbf{e}_{31} + d\mathbf{e}_{12} +\ e\mathbf{e}_{01} + f\mathbf{e}_{02} + g\mathbf{e}_{03} +\ h\mathbf{e}_{0123}$.
`public void `[`load`](#structkln_1_1motor_1a3a048b8d0f35322259f8f1cbaad88cab)`(float * in) noexcept` | Load motor data using two unaligned loads. This routine does *not* assume the data passed in this way is normalized.
56
56
`public void `[`normalize`](#structkln_1_1motor_1a8af12b78c4e98b84c51f605b47dbc0a1)`() noexcept` | Normalizes this motor $m$ such that $m\widetilde{m} = 1$.
@@ -72,7 +72,7 @@ A demonstration of using the exponential and logarithmic map to blend between tw
Direct initialization from components. A more common way of creating a motor is to take a product between a rotor and a translator. The arguments coorespond to the multivector $a + b\mathbf{e}_{12} + c\mathbf{e}_{31} + d\mathbf{e}_{23} +\ e\mathbf{e}_{01} + f\mathbf{e}_{02} + g\mathbf{e}_{03} +\ h\mathbf{e}_{0123}$
75
+
Direct initialization from components. A more common way of creating a motor is to take a product between a rotor and a translator. The arguments coorespond to the multivector $a + b\mathbf{e}_{23} + c\mathbf{e}_{31} + d\mathbf{e}_{12} +\ e\mathbf{e}_{01} + f\mathbf{e}_{02} + g\mathbf{e}_{03} +\ h\mathbf{e}_{0123}$.
`public `[`plane`](#structkln_1_1plane_1a51933d8d8853797034621ce41ad34a8e)`(float a,float b,float c,float d) noexcept` | The constructor performs the rearrangement so the plane can be specified in the familiar form: ax + by + cz + d
18
-
`public `[`plane`](#structkln_1_1plane_1a29dbb1804fa3ec402f901ca8049d60bc)`(float * data) noexcept` | Data should point to four floats with memory layout `(d, a, b, c)` where `d` occupies the lowest address in memory.
18
+
`public explicit `[`plane`](#structkln_1_1plane_1a29dbb1804fa3ec402f901ca8049d60bc)`(float * data) noexcept` | Data should point to four floats with memory layout `(d, a, b, c)` where `d` occupies the lowest address in memory.
19
19
`public explicit `[`plane`](#structkln_1_1plane_1a4fe52a0426bc881947909d0d9b1745d0)`(`[`entity`](../../api/kln_entity#structkln_1_1entity)`< 0b1001 > const & other) noexcept` | Line to plane cast.
20
20
`public void `[`load`](#structkln_1_1plane_1a5a00871dbe19d7658b7e8cda71b326f2)`(float * data) noexcept` | Unaligned load of data. The `data` argument should point to 4 floats corresponding to the `(d, a, b, c)` components of the plane multivector where `d` occupies the lowest address in memory.
21
+
`public void `[`normalize`](#structkln_1_1plane_1ae5e1e0af05e84799d27d7b8782fe5f22)`() noexcept` | Normalize this plane $p$ such that $p \cdot p = 1$.
21
22
`public `[`plane`](#structkln_1_1plane)` KLN_VEC_CALL `[`operator()`](#structkln_1_1plane_1a1c7a11e35d91c2aee88a4152b1799ca9)`(`[`plane`](#structkln_1_1plane)` const & p) const noexcept` | Reflect another plane $p_2$ through this plane $p_1$. The operation performed via this call operator is an optimized routine equivalent to the expression $p_1 p_2 p_1$.
22
23
`public `[`line`](../../api/kln_line#structkln_1_1line)` KLN_VEC_CALL `[`operator()`](#structkln_1_1plane_1a782e4e0b1b93ab5bffb2c972f6d7acfa)`(`[`line`](../../api/kln_line#structkln_1_1line)` const & l) const noexcept` | Reflect line $\ell$ through this plane $p$. The operation performed via this call operator is an optimized routine equivalent to the expression $p \ell p$.
23
24
`public `[`point`](../../api/kln_point#structkln_1_1point)` KLN_VEC_CALL `[`operator()`](#structkln_1_1plane_1a20b6577f6d1717e1ec086314d3ebd497)`(`[`point`](../../api/kln_point#structkln_1_1point)` const & p) const noexcept` | Reflect the point $P$ through this plane $p$. The operation performed via this call operator is an optimized routine equivalent to the expression $p P p$.
@@ -40,7 +41,7 @@ The default constructor leaves memory uninitialized.
40
41
41
42
The constructor performs the rearrangement so the plane can be specified in the familiar form: ax + by + cz + d
Normalize this plane $p$ such that $p \cdot p = 1$.
74
+
75
+
In order to compute the cosine of the angle between planes via the inner product operator `|` , the planes must be normalized. Producing a normalized rotor between two planes with the geometric product `*` also requires that the planes are normalized.
Reflect another plane $p_2$ through this plane $p_1$. The operation performed via this call operator is an optimized routine equivalent to the expression $p_1 p_2 p_1$.
`public explicit `[`point`](#structkln_1_1point_1ad149cbbf9e9a7e77fc680b808e971ee0)`(`[`entity`](../../api/kln_entity#structkln_1_1entity)`< 0b1001 > const & e) noexcept` | A point projected onto a line will have an extinguished partition-0, which necessitates this explicit cast when it is known to be safe.
18
-
`public void `[`load`](#structkln_1_1point_1a805739dde6d772f5b228cce5b95ef13f)`(float * data) noexcept` | Fast load from a pointer to an array of four floats with layout `(w, z, y, x)` where `w` occupies the lowest address in memory.
18
+
`public void `[`load`](#structkln_1_1point_1a805739dde6d772f5b228cce5b95ef13f)`(float * data) noexcept` | Fast load from a pointer to an array of four floats with layout `(w, x, y, z)` where `w` occupies the lowest address in memory.
`public void `[`load_normalized`](#structkln_1_1rotor_1ab063d72ca484de581a78ebd7b49e41da)`(float * data) noexcept` | Fast load operation for packed data that is already normalized. The argument `data` should point to a set of 4 float values with layout `(a, b, c, d)` corresponding to the multivector $a + b\mathbf{e}_{12} + c\mathbf{e}_{31} + d\mathbf{e}_{23}$.
53
+
`public void `[`load_normalized`](#structkln_1_1rotor_1ab063d72ca484de581a78ebd7b49e41da)`(float * data) noexcept` | Fast load operation for packed data that is already normalized. The argument `data` should point to a set of 4 float values with layout `(a, b, c, d)` corresponding to the multivector $a + b\mathbf{e}_{23} + c\mathbf{e}_{31} + d\mathbf{e}_{12}$.
54
54
`public void `[`normalize`](#structkln_1_1rotor_1a4c9b04d0a4119e7d6b56b9e1478db5d4)`() noexcept` | Normalize a rotor such that $\mathbf{r}\widetilde{\mathbf{r}} = 1$.
55
55
`public `[`mat4x4`](../../api/kln_mat4x4#structkln_1_1mat4x4)``[`as_matrix`](#structkln_1_1rotor_1a0f13d2649e679220fc79ee7bc0bbea11)`() const noexcept` | Converts the rotor to a 4x4 column-major matrix.
56
+
`public `[`branch`](../../api/kln_rotor::branch#structkln_1_1rotor_1_1branch)``[`log`](#structkln_1_1rotor_1abdb39aa5e358dd4ceef256b48ef91e81)`() const noexcept` | Returns the principal branch of this rotor's logarithm. Invoking `exp` on the returned result maps back to this rotor.
56
57
`public `[`plane`](../../api/kln_plane#structkln_1_1plane)` KLN_VEC_CALL `[`operator()`](#structkln_1_1rotor_1ae9e58f02352f5241dd94d22353a5e9ec)`(`[`plane`](../../api/kln_plane#structkln_1_1plane)` const & p) const noexcept` | Conjugates a plane $p$ with this rotor and returns the result $rp\widetilde{r}$.
57
58
`public void KLN_VEC_CALL `[`operator()`](#structkln_1_1rotor_1a491f6f2264c6ecf180664e75fc4a159b)`(`[`plane`](../../api/kln_plane#structkln_1_1plane)` * in,`[`plane`](../../api/kln_plane#structkln_1_1plane)` * out,size_t count) const noexcept` | Conjugates an array of planes with this rotor in the input array and stores the result in the output array. Aliasing is only permitted when `in == out` (in place motor application).
58
59
`public `[`line`](../../api/kln_line#structkln_1_1line)` KLN_VEC_CALL `[`operator()`](#structkln_1_1rotor_1ac4d044ea5b98ba540fc5da8d75f43ccc)`(`[`line`](../../api/kln_line#structkln_1_1line)` const & l) const noexcept` | Conjugates a line $\ell$ with this rotor and returns the result $r\ell \widetilde{r}$.
Fast load operation for packed data that is already normalized. The argument `data` should point to a set of 4 float values with layout `(a, b, c, d)` corresponding to the multivector $a + b\mathbf{e}_{12} + c\mathbf{e}_{31} + d\mathbf{e}_{23}$.
80
+
Fast load operation for packed data that is already normalized. The argument `data` should point to a set of 4 float values with layout `(a, b, c, d)` corresponding to the multivector $a + b\mathbf{e}_{23} + c\mathbf{e}_{31} + d\mathbf{e}_{12}$.
80
81
81
82
!!! danger
82
83
The rotor data loaded this way *must* be normalized. That is, the
@@ -90,6 +91,12 @@ Normalize a rotor such that $\mathbf{r}\widetilde{\mathbf{r}} = 1$.
Returns the principal branch of this rotor's logarithm. Invoking `exp` on the returned result maps back to this rotor.
97
+
98
+
Given a rotor $\cos\alpha + \sin\alpha\left[a\ee_{23} + b\ee_{31} +\ c\ee_{23}\right]$, the log is computed as simply $\alpha\left[a\ee_{23} + b\ee_{31} + c\ee_{23}\right]$. This map is only well-defined if the rotor is normalized such that $a^2 + b^2 + c^2 = 1$.
0 commit comments