A domain tells Vex which values belong to it and which ops they have. The tables below come from the domain objects of @mark1russell7/vex-domains, at the time of the build. Thus the tables and the code are the same.
- parameters: the kinds of the arguments after the receiver. The interpreter checks them, and an argument of the wrong kind gives
#VALUE!. “not checked” means that the op does not declare its parameters.
- laws: the claims of the op. The law checker of
@mark1russell7/vex-testkit tests each claim with random values. Refer to the law arena.
- lifts numbers: a number argument becomes a domain value with
fromScalar. For example, add(5) adds the vector (5, 5).
- identity: the value that
reduce gives for an empty list.
- implementation:
method calls the method of the value with the same name. fn calls a function of the domain.
Vec239 ops · fromScalar · valid · encode/decode| op | parameters | laws | lifts numbers | identity | implementation |
|---|
add | domain | commutative, associative | yes | yes | method |
subtract | domain | | yes | | method |
multiply | domain | commutative, associative | yes | yes | method |
divide | domain | | yes | | method |
min | domain | commutative, associative, idempotent | yes | | method |
max | domain | commutative, associative, idempotent | yes | | method |
scale | number | | | | method |
negate | not checked | | | | method |
halve | not checked | | | | method |
abs | not checked | | | | method |
round | not checked | | | | method |
floor | not checked | | | | method |
ceil | not checked | | | | method |
clamp | number, number | | | | method |
swap | not checked | | | | method |
rotate | number | | | | method |
normalize | not checked | | | | method |
lerp | domain, number | | | | method |
length | not checked | | | | method |
lengthSq | not checked | | | | method |
distance | domain | | | | method |
dot | domain | commutative | | | method |
cross | domain | | | | method |
angle | not checked | | | | method |
area | not checked | | | | method |
sum | not checked | | | | method |
minComponent | not checked | | | | method |
maxComponent | not checked | | | | method |
equals | domain | commutative | | | method |
anyNonPositive | not checked | | | | method |
allPositive | not checked | | | | method |
anyNegative | not checked | | | | method |
allNonNegative | not checked | | | | method |
anyZero | not checked | | | | method |
allZero | not checked | | | | method |
anyLessThan | number | | | | method |
allLessThan | number | | | | method |
anyGreaterThan | number | | | | method |
allGreaterThan | number | | | | method |
NDVector15 ops · valid · encode/decode| op | parameters | laws | lifts numbers | identity | implementation |
|---|
add | domain | commutative, associative | | yes | method |
subtract | domain | | | | method |
multiply | domain | commutative, associative | | | method |
mergePreferNonZero | domain | associative, idempotent | | | method |
scale | number | | | | method |
clamp | number, number | | | | method |
dot | domain | commutative | | | method |
length | not checked | | | | method |
norm1 | not checked | | | | method |
normInf | not checked | | | | method |
equals | domain | commutative | | | method |
pick | not checked | | | | method |
withKeys | not checked | | | | method |
get | string | | | | method |
set | string, number | | | | method |
NDVector(lifted)15 ops · fromScalar · valid| op | parameters | laws | lifts numbers | identity | implementation |
|---|
add | domain | commutative, associative | yes | yes | method |
subtract | domain | | yes | | method |
multiply | domain | commutative, associative | yes | | method |
mergePreferNonZero | domain | associative, idempotent | | | method |
scale | number | | | | method |
clamp | number, number | | | | method |
dot | domain | commutative | yes | | method |
length | not checked | | | | method |
norm1 | not checked | | | | method |
normInf | not checked | | | | method |
equals | domain | commutative | | | method |
pick | not checked | | | | method |
withKeys | not checked | | | | method |
get | string | | | | method |
set | string, number | | | | method |
| op | parameters | laws | lifts numbers | identity | implementation |
|---|
toNDVector | not checked | | | | fn |
Color6 ops · fromScalar · valid · encode/decode| op | parameters | laws | lifts numbers | identity | implementation |
|---|
add | domain | commutative, associative | | yes | method |
multiply | number | | | | method |
clamp | number, number | | | | method |
mix | domain, number | | | | method |
luminance | not checked | | | | method |
equals | domain | commutative | | | method |
Angle8 ops · fromScalar · valid · encode/decode| op | parameters | laws | lifts numbers | identity | implementation |
|---|
add | domain | commutative, associative | yes | yes | method |
subtract | domain | | yes | | method |
scale | number | | | | method |
normalize | not checked | | | | method |
toVec2 | number | | | | method |
sin | not checked | | | | method |
cos | not checked | | | | method |
degrees | not checked | | | | method |
| op | parameters | laws | lifts numbers | identity | implementation |
|---|
add | number | commutative, associative | | yes | fn |
subtract | number | | | | fn |
multiply | number | commutative, associative | | yes | fn |
divide | number | | | | fn |
mod | number | | | | fn |
pow | number | | | | fn |
min | number | commutative, associative, idempotent | | | fn |
max | number | commutative, associative, idempotent | | | fn |
clamp | number, number | | | | fn |
abs | not checked | | | | fn |
negate | not checked | | | | fn |
sqrt | not checked | | | | fn |
floor | not checked | | | | fn |
ceil | not checked | | | | fn |
round | not checked | | | | fn |
gt | number | | | | fn |
gte | number | | | | fn |
lt | number | | | | fn |
lte | number | | | | fn |
eq | number | commutative | | | fn |
| op | parameters | laws | lifts numbers | identity | implementation |
|---|
and | boolean | commutative, associative, idempotent | | yes | fn |
or | boolean | commutative, associative, idempotent | | yes | fn |
xor | boolean | commutative, associative | | yes | fn |
not | not checked | | | | fn |
eq | boolean | commutative | | | fn |
| op | parameters | laws | lifts numbers | identity | implementation |
|---|
invoke | not checked | | | | method |
| op | parameters | laws | lifts numbers | identity | implementation |
|---|
isTop | not checked | | | | method |
isBottom | not checked | | | | method |
map | not checked | | | | method |
chain | not checked | | | | method |
valueOr | not checked | | | | method |