One way to approach this topic that can help is to distinguish between points and vectors as distinct types and make sure your operations fit into one of the "known good" scenarios:
- Point + Vector = Point
- Point - Vector = Point
- Point - Point = Vector
- Point + Point = total nonsense
- Scalar * Vector = Vector
eg. -1 * Vector = -Vector, the reverse direction
- Scalar * Point = total nonsense
eg. -1 * Point = a conceptual mistake, you can reverse a vector but not a point
You can think of this as the points are the real dots on the screen and vectors are just invisible arrows. You can only get a point from a vector if you attach it (ie. add it) to another point.
You can also kind of think of this as the points are unsigned quantities and the vectors are signed quantities. The points have only position, whereas the vectors have only direction -- even though they can have the exact same representation in the computer. You could enforce the distinction to some degree by using integers for points and floating point for vector components. This also emphasizes the scalability of vectors, a feature that points lack.
Aside: a more apt analogy in programming might be to consider points as *
pointers and vectors as ptrdiff_t
s. But those would be a bad choice of types for implementing these objects for graphics.