Skip to content

Points and Vectors Addition

Point and vector addition has the same properties as regular real numbers. It is performed element-wise for each of the X, Y and Z coordinates / components. Specifically, suppose the following two points and vectors are defined:

p = Point3d( px, py, pz )
q = Point3d( qx, qy, qz )

u = Vector3d( ux, uy, uz )
v = Vector3d( vx, vy, vz )

The results of adding those respectively are seen below. Note that Rhino's geometry library support natively the addition of points and vectors using the + operator.

Vector Addition Figure

""" Addition
"""
o =  Point3d( px + qx,
              py + qy,
              pz + qz )
w = Vector3d( ux + vx,
              uy + vy,
              uz + vz )
""" Shortcut
"""
o = p + q
w = u + v

Algebraic Properties

  1. Point and vector addition is commutative in the sense that it doesn’t matter in which order vectors are added. It is thus symmetric in the sense p + q = q + p and u + v = v + u.

  2. Addition is also associative in that the terms can be grouped in different ways with the same result: ( p + q ) + o = p + ( q + o ) and ( u + v ) + w = u + ( v + w ).

  3. There exists a special identity point and vector, namely [0.0, 0.0, 0.0] that produces no effect under addition. For points this is also known as the origin and for vectors as the zero or null vector.

Geometric Interpretation

The semantics of point and vector addition are associated with the geometric transformation of translation and compounding displacements, respectively.

Point Translation

Adding a point and a vector can be considered as the act of moving the point by the displacement encoded in the vector.

Vector Translation Figure

Compounding Vectors

Summing two of more vectors can be considered as computing the combined motion along multiple directions. Note that both the direction and the length of the resulting vector change. Additionally, from the figure below it is easy to see that the order of performing addition does not matter.

Vector Addition Figure

Peculiar Cases

Adding two or more points is not as conceptually straight forward, unless we interpret points as vector from some origin. For instance consider points p = [px, py, pz] and q = [qx, qy, qz]. We can consider the points p and q as vectors from an origin o = [0.0, 0.0, 0.0], as u = [px - 0.0, py - 0.0, pz - 0.0] and v = [qx - 0.0, qy - 0.0, qz - 0.0]. Adding the two vectors produces u + v = [px + qx, py + qy, pz + qz]. Now we reverse the points are vectors from an origin logic to conclude that p + q = u + v.

Point Addition Figure

Type Conversion

The following rules of automatic type conversion are enforced by Rhino when mixing points and vectors. Interestingly, the type conversion is not symmetric but instead prioritizes points. The reason for this is because point and vector addition, independent of the order is logically associated with translation. The summation of points can be considered as a process of compounding their coordinates. This by itself makes little sense, but if we consider that points can be understood as vectors from from an implied origin at [0.0, 0.0, 0.0] then it is equivalent of computing the aggregate displacement.

Type A + Type B = Type A + B Interpretation
Point3d + Point3d = Point3d ⚠ Compounding
Point3d + Vector3d = Point3d ✅ Translation
Vector3d + Point3d = Point3d ⚠ Translation
Vector3d + Vector3d = Vector3d ✅ Compounding