From 56d49256a0697a76ec3a4b9a7feb2005a12593e7 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Mon, 6 May 2024 04:35:31 -0400 Subject: [PATCH] Fix issues with guide sections --- docs/DataTypes.md | 22 +--------------------- docs/Main.md | 2 +- docs/Operations.md | 5 ++++- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/docs/DataTypes.md b/docs/DataTypes.md index ea3f118..749aeea 100644 --- a/docs/DataTypes.md +++ b/docs/DataTypes.md @@ -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 diff --git a/docs/Main.md b/docs/Main.md index 8ace64d..f262d0e 100644 --- a/docs/Main.md +++ b/docs/Main.md @@ -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!) diff --git a/docs/Operations.md b/docs/Operations.md index 55f131a..a2e6af8 100644 --- a/docs/Operations.md +++ b/docs/Operations.md @@ -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.