Fix issues with guide sections
This commit is contained in:
parent
b9aeddadec
commit
56d49256a0
|
@ -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
|
||||
```
|
||||
|
||||
The `TransType` parameter dictates what kind of transform it is. These eight options are currently available:
|
||||
|
||||
**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.
|
||||
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.
|
||||
|
||||
### Permutations
|
||||
|
||||
|
|
|
@ -13,4 +13,4 @@ If you're familiar with the Python library [NumPy](https://numpy.org/) or anythi
|
|||
|
||||
### Advanced Concepts
|
||||
|
||||
5. Array Representations
|
||||
5. Array Representations (coming soon!)
|
||||
|
|
|
@ -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)
|
||||
- `StartBound x` - Every index from `x` to the end of the axis
|
||||
- `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
|
||||
- `Indices xs` - A list of indices in the axis
|
||||
- `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
|
||||
matrix [[2, 0], [1, 2]] !!.. [All, One 0]
|
||||
== vector [2, 1]
|
||||
```
|
||||
|
||||
`One'` does not decrease the rank of the result in this way.
|
||||
|
||||
## 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.
|
||||
|
|
Loading…
Reference in a new issue