01_user_documentation:07_rgg_xl:02_xl:09_java_addition:overload_operator:04_sub
This is an old revision of the document!
Table of Contents
sub
The subtract operator โsubโ (-, operator$sub) by default overloaded for VecMath and chem.
VecMath
For vector mathematics the sub operator is used for the different vectors and points:
- Vector2f
- Vector2d
- Point2f
- Point2d
- Vector3f
- Vector3d
- Point3d
- Point3f
- Vector4d
- Vector4f
- Point4d
- Point4f
Vector3f a = new Vector3f(0,1,2); Vector3f b = new Vector3f(0,2,3); println(a - b); //(0.0, -1.0, -1.0) println(a - a - b); //(0.0, -2.0, -3.0)
This can be combined between vectors and points of the same dimension. E.g. Point2f and Vector2f or Point2d and Point2f.
Volumes
The sub operator is defined for different volumes:
- CSGComplement
- VolumeBase
It is used to create a CSGDifference object (The difference consists of all points which are contained in the first volume, but not in one or more of the remaining volumes.).
01_user_documentation/07_rgg_xl/02_xl/09_java_addition/overload_operator/04_sub.1774613062.txt.gz ยท Last modified: 2026/03/27 13:04 by Tim
