From b6bcf214e638fd36ef7d76c9f573a84e6e016482 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 11 Jun 2022 20:08:12 -0400 Subject: Nothing but edits yet again --- docs/doc/take.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'docs/doc/take.html') diff --git a/docs/doc/take.html b/docs/doc/take.html index 1dd895ff..1c976976 100644 --- a/docs/doc/take.html +++ b/docs/doc/take.html @@ -38,15 +38,16 @@
  • 𝕩 can be an atom, or array of any rank (the result will be an array).
  • 𝕨 can be negative to take or drop from the end instead of the beginning.
  • For Take, if 𝕨 is larger than the length of 𝕩, then fills are added.
  • -
  • 𝕨 can have multiple numbers corresponding to leading axes of 𝕩.
  • +
  • 𝕨 can have multiple numbers corresponding to leading axes of 𝕩.
  • 𝕨 is allowed to be longer than the rank of 𝕩; 𝕩 will be extended to fit.
  • -

    These extensions can be combined as well, so there are a lot of possibilities. A good picture to have in mind is cutting out a corner of the array 𝕩. This is because the result 𝕨↑𝕩 or 𝕨↓𝕩 always aligns with one side of 𝕩 along each axis, so it aligns with the corner where those sides meet.

    +

    These extensions can be combined as well, so there are a lot of possibilities. A good picture to have in mind is cutting out a corner of the array 𝕩. This is because the result 𝕨↑𝕩 or 𝕨↓𝕩 always aligns with one side of 𝕩 along each axis, so it also aligns with the corner where those sides meet.

    The result d↓𝕩 is always the same as t↑𝕩 for some other argument t, but computing t wouldn't be too convenient. The reverse isn't true: only Take can insert fills, so results that include them can't come from Drop.

    One axis

    -

    Let's start with a natural number 𝕨. Take gives the first 𝕨 major cells of 𝕩 (or elements of a list), while Drop gives all but the first 𝕨.

    -↗️
        4 ↑ "take and drop"
    +

    Let's start with a natural number 𝕨. Take gives the first 𝕨 major cells of 𝕩 (or elements of a list), while Drop gives all but the first 𝕨.

    +↗️
        4 ↑ "take and drop"
     "take"
    +
         4 ↓ "take and drop"
     " and drop"
     
    @@ -77,7 +78,7 @@
     ⟨⟩
     

    Negative argument

    -

    If 𝕨 is negative then wraps around the other side to take or drop from the end of 𝕩. It's a lot like negative indices in Select (⊏), but while negative indices are asymmetricβ€”0 is the first entry but Β―1 is the lastβ€”this case is symmetric. It's because the place to cut is always before the index 𝕨, cancelling out the negative index asymmetry.

    +

    If 𝕨 is negative, it wraps around the other side to take or drop from the end of 𝕩. It's a lot like negative indices in Select (⊏), but while negative indices are asymmetricβ€”0 is the first entry but Β―1 is the lastβ€”this case is symmetric. It's because the place to cut is always before the index 𝕨, cancelling out the negative index asymmetry.

    ↗️
        3 ↑ "abcdeEDCBA"
     "abc"
     
    @@ -94,12 +95,12 @@
         0 ↓ 4β€Ώ3β€Ώ2  # Everything
     ⟨ 4 3 2 ⟩
     
    -

    If |𝕨 is too large, then Take will insert fills at the beginning to keep the result aligned with 𝕩 at the end. Drop returns an empty array as in the positive case. So unlike Rotate (⌽), which is completely cyclical, Take and Drop work cyclically only around 0.

    +

    If |𝕨 is too large, then Take will insert fills at the beginning to keep the result aligned with 𝕩 at the end. Drop returns an empty array as in the positive case. So unlike Rotate (⌽), which is completely cyclical, Take and Drop look cyclic only around 0.

    ↗️
        Β―6 ↑ "xy"
     "    xy"
     

    Multiple axes

    -

    In the general case 𝕨 is a list of integers. They're matched with the leading axes of 𝕩, so that each affects one axis independently from the others.

    +

    In the general case 𝕨 is a list of integers. They're matched with the leading axes of 𝕩, so that each affects one axis independently from the others.

    ↗️
        ⊒ m ← (10×↕5) +⌜ ↕7
     β”Œβ”€                      
     β•΅  0  1  2  3  4  5  6  
    -- 
    cgit v1.2.3