Fix issues with guide sections

This commit is contained in:
Kiana Sheibani 2024-05-06 04:35:31 -04:00
parent b9aeddadec
commit 56d49256a0
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
3 changed files with 6 additions and 23 deletions

View file

@ -125,27 +125,7 @@ A transform is a wrapper type for a square matrix with certain properties that c
Transform : (ty : TransType) -> (n : Nat) -> (a : Type) -> Type Transform : (ty : TransType) -> (n : Nat) -> (a : Type) -> Type
``` ```
The `TransType` parameter dictates what kind of transform it is. These eight options are currently available: The `TransType` parameter dictates what kind of transform it is. More information on transforms and their operations can be found in the [Transforms](Transforms.md) chapter.
**Linear Types:**
- `Trivial` (always the identity transformation)
- `Rotation`
- `Orthonormal` (rotation + reflection)
- `Linear`
**Affine Types:**
- `Translation`
- `Rigid` (rotation + translation)
- `Isometry` (rotation + reflection + translation)
- `Affine`
The `TransType` value is obtained by prepending a capital T to these names. For example, an isometry may have the type `Isometry 3 Double`, which is an alias for `Transform TIsometry 3 Double`.
#### The Point Type
Transforms behave differently from regular matrices when applied to a vector. When a non-linear transform is used, the transform is first linearized, so that vectors only have linear transformations applied to them. **This is not a bug!**
In order to properly apply these transforms, the `Point` type must be used, which is a wrapper around the `Vector` type that supports these transforms. This separation between points and vectors is intended to make working with affine transformations more convenient, as it mirrors the separation between points and vectors in affine algebra.
### Permutations ### Permutations

View file

@ -13,4 +13,4 @@ If you're familiar with the Python library [NumPy](https://numpy.org/) or anythi
### Advanced Concepts ### Advanced Concepts
5. Array Representations 5. Array Representations (coming soon!)

View file

@ -85,17 +85,20 @@ With ranged indexing, a sub-array of the original array is accessed or modified.
- `Bounds x y` - Every index from `x` (inclusive) to `y` (exclusive) - `Bounds x y` - Every index from `x` (inclusive) to `y` (exclusive)
- `StartBound x` - Every index from `x` to the end of the axis - `StartBound x` - Every index from `x` to the end of the axis
- `EndBound y` - Every index from the start of the axis to `y` - `EndBound y` - Every index from the start of the axis to `y`
- `One i`, `One' i` - The single index `i`
- `All` - Every index in the axis - `All` - Every index in the axis
- `Indices xs` - A list of indices in the axis - `Indices xs` - A list of indices in the axis
- `Filter p` - A predicate specifying which indices to access or modify - `Filter p` - A predicate specifying which indices to access or modify
There is also an extra specifier, `One i`, that selects exactly one index of the axis. It is only usable in safe indexing, and it is notable for being the only range specifier that decreases the rank of the sub-array. For example, the following matrix access returns the first column as a vector due to `One` being used: The range specifier `One` is special, as it is the only range specifier that decreases the rank of the resulting array. For example, the following matrix access returns the first column as a vector due to `One` being used:
```idris ```idris
matrix [[2, 0], [1, 2]] !!.. [All, One 0] matrix [[2, 0], [1, 2]] !!.. [All, One 0]
== vector [2, 1] == vector [2, 1]
``` ```
`One'` does not decrease the rank of the result in this way.
## Standard Interface Methods ## Standard Interface Methods
The array type implements a number of standard interfaces. Most of these implementations are unremarkable, but a few have caveats that are worth noting. The array type implements a number of standard interfaces. Most of these implementations are unremarkable, but a few have caveats that are worth noting.