Help define laws/patterns for 2D scalar number system arithmetic - tetracoords

48 Views Asked by At

Tetracoordinates as a 2D scalar number system

Math is generally not my specialty, but as a programmer I've been entertaining the idea of a 2D scalar number system (called tetracoordinates for now). The original motivation was to create a datatype that could represent a location, in this case in 2 dimensions, with a scalar value.

I posted a general overview at dev.to, where near the end I began trying to define some general laws (ex. algebraic laws) and got stuck.

The approach is to divide the coordinate space in which we can express locations into regions/cells in such a way that:

  • Each region is the same shape and size.
  • The region representing the origin is at the center.
  • The coordinate space can acquire new regions (more scale) and subdivide existing regions (more precision) in a regular/predictable manner.

Here's a minimal coordinate space divided using tetracoordinates:

4 cells 1 place value

See the linked dev.to article for more illustrated examples.

Note each cell's contained space is represented by a unique scalar tetracoord value (0, 1, 2, 3). Since each level of precision/scale refers to 4 values, it makes sense for tetracoord values to be expressed as base-4 (quaternary) numbers.

0, 1, 2, 3, 10, 11, 12, 13, 20, 21, 22, 23, ...

Also note that any given cell will be subdivided using this same pattern, with 0 centered, 1 along the vertical axis, 2 next counterclockwise, and 3 last counterclockwise. So at each change in level (scale or precision), the orientation of these cells is rotated 180˚.

One Question

The format of this site is generally 1 question gets ~1 answer, but I'm actually just looking for general help exploring the arithmetic, algebraic, etc laws of this number system.

To that end, I'll just start with:

Is there a definite reason why the tetracoord system as described above would break down at some point?

For example, I'm wondering if the fact that there don't really exist unique negatives is enough to abandon the hope of applying general arithmetic.

Arithmetic

My approach for attempting arithmetic so far has been to think of each tetracoord value as the centroid of its corresponding cell, which is an equilateral triangle.

equilateral triangle geometry rules

Note the variables x, y, z below do not stand for just any value. It is a single digit in a single place value (one of: {0,1,2,3}).

Note I'm using a particular notation with . as a place value separator, and .. as an equivalent to the decimal point as used with normal numbers.

Below are some initial rules:

0 + 0 = 0
0 + x = x
0 - x = 0..x̄

-z =   0..z̄
   =   x..ȳ
   =   y..x̄
   = z.x..ȳ
   = z.y..x̄
   = z.0..z̄

x + x =     x..x̄
      =    2x     <-- coefficient is normal scalar 2 here
      =   y.z..z̄
      =   z.y..ȳ
      = x.0.x..x̄
      = x.y.z..z̄
      = x.z.y..ȳ

x.y = x.0 - y

x + y + z = 0
x + y     = -z

x - y     = y.z

Discussion

I created a subreddit room at reddit.com/r/tetracoords for anything related to this number system other than the single question asked above... assuming and hoping that the answer is no, tetracoord arithmetic (and algebra, etc) should be possible.

1

There are 1 best solutions below

2
On

Number notation for complex numbers with radix $-2$ and digit-set $\{0,1,\omega,\omega^2\}$, where $\omega = e^{i2\pi/3}$.

There is some literature on this. Perhaps also search "Eisenstein integers".