Skip to main content
deleted 17 characters in body
Source Link
Zgarb
  • 42.8k
  • 4
  • 79
  • 259

 

 
added 2333 characters in body
Source Link
Zgarb
  • 42.8k
  • 4
  • 79
  • 259
  • Dividing by a nonzero integer gives a rational number by default.

    Dividing by a nonzero integer gives a rational number by default.
  • Dividing a positive number by zero gives infinity.

    Dividing a positive number by zero gives infinity.
  • Dividing a negative number by zero gives negative infinity.

    Dividing a negative number by zero gives negative infinity.
  • Dividing zero by zero gives a special value "Any", which is equal to every finite number, but not equal to the infinities.

    foV≠Fz/ fo Filter by condition: F Fold by z/ element-wise division: [xB/xA,yB/yA] V≠ This list contains an unequal pair.

    Dividing zero by zero gives a special value "Any", which is equal to every finite number, but not equal to the infinities.

foV≠Fz/
fo       Filter by condition:
    F      Fold by
     z/    element-wise division: [xB/xA,yB/yA]
  V≠       This list contains an unequal pair.
  • Dividing by a nonzero integer gives a rational number by default.

  • Dividing a positive number by zero gives infinity.

  • Dividing a negative number by zero gives negative infinity.

  • Dividing zero by zero gives a special value "Any", which is equal to every finite number, but not equal to the infinities.

    foV≠Fz/ fo Filter by condition: F Fold by z/ element-wise division: [xB/xA,yB/yA] V≠ This list contains an unequal pair.

  • Dividing by a nonzero integer gives a rational number by default.
  • Dividing a positive number by zero gives infinity.
  • Dividing a negative number by zero gives negative infinity.
  • Dividing zero by zero gives a special value "Any", which is equal to every finite number, but not equal to the infinities.

foV≠Fz/
fo       Filter by condition:
    F      Fold by
     z/    element-wise division: [xB/xA,yB/yA]
  V≠       This list contains an unequal pair.
added 2333 characters in body
Source Link
Zgarb
  • 42.8k
  • 4
  • 79
  • 259

This is an infinite list of point pairs [[xA,yA],[xB,yB]]. For some reason TIO refuses to print an initial segment before running out of time, so the link cuts it after 8 elements (the 9th would take too long).

Explanation

First we generate all point pairs.

m½π4ΘN
     N Infinite list of positive integers: [1,2,3..]
    Θ  Prepend zero: [0,1,2,3..]
  π4   Cartesian 4th power: [[0,0,0,0],[0,0,0,1],[1,0,0,0]..]
m½     Split each in half: [[[0,0],[0,0]],[[0,0],[0,1]],[[1,0],[0,0]]..]

Next we discard duplicates. I'll add an explanation when I canThis is done by creating the list of equivalent point pairs and checking that the current one is the lexicographic maximum.

fo§=←▲S+m↔
fo          Filter by condition:
        m↔    Reverse each: [[yA,xA],[yB,xB]]
      S+      Concatenate with the current point pair: [[xA,yA],[xB,yB],[yA,xA],[yB,xB]]
     ▲        The maximum of this list of 4 points
    ←         and its first element [xA,yA]
  §=          are equal.

Then we remove degenerate triangles by dividing B element-wise by A and checking that the results are distinct. Husk handles division so that this works out:

  • Dividing by a nonzero integer gives a rational number by default.

  • Dividing a positive number by zero gives infinity.

  • Dividing a negative number by zero gives negative infinity.

  • Dividing zero by zero gives a special value "Any", which is equal to every finite number, but not equal to the infinities.

    foV≠Fz/ fo Filter by condition: F Fold by z/ element-wise division: [xB/xA,yB/yA] V≠ This list contains an unequal pair.

Finally, we verify the friendly incenter condition. This is done by computing the squares of the three sides, dividing out square factors and checking that the results are equal.

foË(...)S:Fz-
fo             Filter by condition:
          F      Fold by
           z-    element-wise subtraction
        S:       and prepend to the point pair: [[xB-xA,yB-yA],[xA,yA],[xB,yB]]
  Ë(...)         The results of ... are equal for these three points.

fεṁC2gpṁ□  Compute (a value corresponding to) d from a point (x,y) of magnitude n√d
       ṁ   Map and sum
        □  square: x²+y²
      p    Prime factors, say [2,2,2,2,2,3,5,5]
     g     Group equal adjacent elements: [[2,2,2,2,2],[3],[5,5]]
  ṁ        Map and concatenate
   C2      splitting into chunks of length 2: [[2,2],[2,2],[2],[3],[5,5]]
fε         Keep singletons: [[2],[3]]

This is an infinite list of point pairs [[xA,yA],[xB,yB]]. For some reason TIO refuses to print an initial segment before running out of time, so the link cuts it after 8 elements (the 9th would take too long). I'll add an explanation when I can.

This is an infinite list of point pairs [[xA,yA],[xB,yB]]. For some reason TIO refuses to print an initial segment before running out of time, so the link cuts it after 8 elements (the 9th would take too long).

Explanation

First we generate all point pairs.

m½π4ΘN
     N Infinite list of positive integers: [1,2,3..]
    Θ  Prepend zero: [0,1,2,3..]
  π4   Cartesian 4th power: [[0,0,0,0],[0,0,0,1],[1,0,0,0]..]
m½     Split each in half: [[[0,0],[0,0]],[[0,0],[0,1]],[[1,0],[0,0]]..]

Next we discard duplicates. This is done by creating the list of equivalent point pairs and checking that the current one is the lexicographic maximum.

fo§=←▲S+m↔
fo          Filter by condition:
        m↔    Reverse each: [[yA,xA],[yB,xB]]
      S+      Concatenate with the current point pair: [[xA,yA],[xB,yB],[yA,xA],[yB,xB]]
     ▲        The maximum of this list of 4 points
    ←         and its first element [xA,yA]
  §=          are equal.

Then we remove degenerate triangles by dividing B element-wise by A and checking that the results are distinct. Husk handles division so that this works out:

  • Dividing by a nonzero integer gives a rational number by default.

  • Dividing a positive number by zero gives infinity.

  • Dividing a negative number by zero gives negative infinity.

  • Dividing zero by zero gives a special value "Any", which is equal to every finite number, but not equal to the infinities.

    foV≠Fz/ fo Filter by condition: F Fold by z/ element-wise division: [xB/xA,yB/yA] V≠ This list contains an unequal pair.

Finally, we verify the friendly incenter condition. This is done by computing the squares of the three sides, dividing out square factors and checking that the results are equal.

foË(...)S:Fz-
fo             Filter by condition:
          F      Fold by
           z-    element-wise subtraction
        S:       and prepend to the point pair: [[xB-xA,yB-yA],[xA,yA],[xB,yB]]
  Ë(...)         The results of ... are equal for these three points.

fεṁC2gpṁ□  Compute (a value corresponding to) d from a point (x,y) of magnitude n√d
       ṁ   Map and sum
        □  square: x²+y²
      p    Prime factors, say [2,2,2,2,2,3,5,5]
     g     Group equal adjacent elements: [[2,2,2,2,2],[3],[5,5]]
  ṁ        Map and concatenate
   C2      splitting into chunks of length 2: [[2,2],[2,2],[2],[3],[5,5]]
fε         Keep singletons: [[2],[3]]
Source Link
Zgarb
  • 42.8k
  • 4
  • 79
  • 259
Loading