OpenSCAD User Manual/Mathematical Operators
||The text in its current form is incomplete.|
Scalar Arithmetical Operators
The scalar arithmetical operators take numbers as operands and produce a new number.
The "-" can also be used as prefix operator to negate a number.
All relational operator take numbers as operands and produce a Boolean value. The equal and not-equal operators can also compare Boolean values.
All logical operators take Boolean values as operands and produce a Boolean value.
The ?: operator can be used to conditionally evaluate one or another expression. It works like the ?: operator from the family of C-like programming languages.
|? :||Conditional operator|
a=1; b=2; c= a==b ? 4 : 5;
If a equals b, then c is set to 4, else c is set to 5.
The vector-number operators take a vector and a number as operands and produce a new vector.
|*||multiply all vector elements by number|
|/||divide all vector elements by number|
The vector operators take vectors as operands and produce a new vector.
The "-" can also be used as prefix operator to element-wise negate a vector.
Vector Dot-Product Operator
The vector dot-product operator takes two vectors as operands and produces a scalar.
|*||sum of vector element products|
Multiplying a matrix by a vector, vector by matrix and matrix by matrix