⍝ Relationship between point and k-ball:

    ⎕io←0                           ⍝ Environment for tests.

    kball .5                        ⍝ Inside the unit interval
¯1

    2 1 kball 1 3⍴2 3 4
¯1 0 1

    kball .5 .5                     ⍝ Inside the unit circle.
¯1
    kball ¯1 0                      ⍝ On the boundary of the unit circle.
0
    kball .8 .9                     ⍝ Outside the unit circle.
1
    5 kball 2 3                     ⍝ Inside the circle.
¯1
    5 kball 3 4                     ⍝ On the boundary.
0
    5 kball 5 6                     ⍝ Outside the circle.
1
    5 1 2 kball 2 3,4 6,⍪9 9        ⍝ Radius 5; center at (1,2).
¯1 0 1

    13 kball 5 6 7                  ⍝ Inside the sphere.
¯1
    13 kball 3 4 12                 ⍝ On the surface.
0
    13 kball 6 8 12                 ⍝ Outside the sphere.
1

⍝ Sphere of Radius 13; center at (¯1,2,¯3), 3 points:

    13 ¯1 2 ¯3 kball 4 2 9,2 6 15,⍪2 1 4
0 1 ¯1


Back to: code

Back to: Workspaces