Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 5

Points and Vectors in 2D and 3D

Recommended resources

Welcome to the second module of our course. In the first module, we explored the conceptual foundations of parametric design, tracing its history and understanding why it has become such a transformative force in architecture—offering powerful advantages in fabrication, performance, and adaptability. We saw that at its core, parametric design is about defining a system of rules and relationships rather than a static object.

To build such systems, we need a precise language. This module provides that language: the mathematics of geometry. We will start from the ground up to ensure we have a solid, shared foundation. Given your background in mathematics and physics, this first lesson will serve as a formal review of the most fundamental concepts: points, vectors, and the Cartesian coordinate systems they inhabit. A clear understanding of these elements is the essential first step before we can manipulate them to create the complex forms you're interested in.

The Stage: Cartesian Coordinate Systems

Before we can describe any object or movement, we need a frame of reference. In computational geometry, this is almost always the Cartesian coordinate system, named after René Descartes. You're certainly familiar with it, but a quick, rigorous review will ensure we're aligned on terminology, especially as we move from 2D to 3D.

Cartesian Coordinate Systems

This chapter from 3D Math Primer for Graphics and Game Development offers a clear and structured review of Cartesian space.

Begin by reading the first part, 2D Cartesian Space. This section formally re-introduces the origin, the x- and y-axes, and the use of an ordered pair of coordinates (x, y) to define the location of a point on a plane. Pay attention to the distinction between the abstract, infinite mathematical space and its various representations, like screen coordinates.

Extending this system to three dimensions is conceptually straightforward: we add a third axis, the z-axis, which is mutually perpendicular to the x- and y-axes. This creates a 3D space where any point can be located with an ordered triplet (x, y, z). However, this extension introduces a subtle but critical new property: handedness.

Most 3D applications, including Rhino/Grasshopper and Blender, use a right-handed coordinate system. To visualize this, if you point the fingers of your right hand along the positive x-axis and curl them toward the positive y-axis, your thumb will point in the direction of the positive z-axis. A left-handed system would have the z-axis pointing in the opposite direction. While the choice is a matter of convention, being aware of it is crucial, as mixing up handedness can lead to mirrored or inverted results when translating formulas or models between different software environments.

Now, let's continue with the reading to formalize these 3D concepts.

Cartesian Coordinate Systems

This next section extends the 2D concepts into 3D and formally defines handedness.

Please read the sections on 3D space and locating points and the following section, on handedness. The text describes both systems in detail. While the book itself adopts a left-handed convention for its examples, the explanation of the right-hand rule and the differences between the systems is universally applicable.


The Characters: Points and Vectors

With our 3D stage set, we can introduce the two main characters that populate it: points and vectors. In everyday language, these terms are sometimes used loosely, but in computational design, their distinction is paramount.

  • A Point represents a specific location in space. It has no size or dimension; it is simply a set of coordinates, such as (x, y, z), that marks a position relative to the origin of the coordinate system.

  • A Vector, on the other hand, represents direction and magnitude (or length). It does not have a location. Think of it as an instruction for movement: "go this far in this direction." A vector is also represented by three numbers, like [x, y, z], but these numbers are its components, describing its displacement along each axis.

The ParametricCamp video series provides an excellent, design-focused explanation of this distinction.

6.1 Vectors - Intro to Parametric Modeling

This video introduces the concept of a vector from a parametric modeling perspective.

Please watch the first few minutes, from the introduction up to the end of the conceptual explanation. The speaker does a great job of emphasizing that a vector represents orientation, direction, and magnitude, but not location. Notice the illustration showing that identical arrows at different locations represent the same vector.

Because a vector has no fixed position, it can be visualized as an arrow starting from any point. However, when we place the tail of a vector at the origin (0, 0, 0), its tip points to the coordinates that define its components. This special case is called a position vector, as it conveniently describes the position of a point in space.

A position vector starts at the origin of the coordinate system and ends at a specific point. The coordinates of the point `(x, y, z)` are identical to the components of the vector that points to it.

A position vector starts at the origin of the coordinate system and ends at a specific point. The coordinates of the point (x, y, z) are identical to the components of the vector that points to it.


Relating Points and Vectors

The real power of vectors emerges when we use them in relation to points. Since points define locations and vectors define displacements, we can use them together to navigate and construct geometry.

Creating a Vector from Two Points

A very common operation is to find the vector that leads from one point to another. If we have a starting point A and an ending point B, the vector that connects them, written as , is found by subtracting the coordinates of A from the coordinates of B.

The resulting vector represents the direction and distance one must travel to get from A to B.

To find the vector \(\vec{AB}\) between point A and point B, we subtract the components of the starting point's position vector (\(\vec{OA}\)) from the ending point's position vector (\(\vec{OB}\)). The result is a new vector whose components represent the displacement from A to B.

To find the vector between point A and point B, we subtract the components of the starting point's position vector () from the ending point's position vector (). The result is a new vector whose components represent the displacement from A to B.

The Duality of Points and Vectors

As you've seen, both points and vectors are stored as a set of three numbers. This isn't a coincidence; it's a fundamental concept in computational geometry. For a computer, there is no intrinsic difference between a point (x, y, z) and a vector [x, y, z]. The difference lies purely in our interpretation and how we use them.

This duality allows for powerful and elegant operations. For instance, what does it mean to "add" a vector to a point? Geometrically, it means moving the point.

Point (new) = Point (original) + Vector

This operation takes the original coordinates of the point and adds the components of the vector to them, resulting in a new point displaced from the original. This is the mathematical basis for the translation transformation, which we will explore in detail soon.

The following segment of the ParametricCamp video explains this crucial concept.

6.1 Vectors - Intro to Parametric Modeling

This section discusses the interchangeability of points and vectors in code and what it means to perform arithmetic operations between them.

Watch the clip from the start of the discussion on the properties of vectors. Pay close attention to the explanation of what happens when you add a point and a vector together. This is perhaps the single most important operation for procedural geometry creation.


Conclusion

In this lesson, we have reset our foundation by reviewing the core elements of computational geometry. While these concepts are familiar from your math and physics background, we have reframed them through the specific lens of parametric design.

Here are the key takeaways:

  • Coordinate Systems: We work within a 3D Cartesian coordinate system, which, in most design software, is right-handed. Points are located by an (x, y, z) coordinate triplet.
  • Points vs. Vectors: A point is a pure location. A vector is a pure direction and magnitude, represented by [x, y, z] components. It has no fixed location.
  • Fundamental Operations: A vector can be created between two points by subtracting the start point's coordinates from the end point's. Adding a vector to a point results in a new, translated point.
  • Computational Duality: In a computer, points and vectors are both just lists of three numbers. Their geometric meaning—location or displacement—is determined by the context of the operation.

Now that we have established our geometric "alphabet," we are ready to form "words" and "sentences." In the next lesson, we will delve into two fundamental vector operations: the dot product and the cross product. These operations will allow us to measure angles, determine perpendicularity, and find surface orientations—all indispensable calculations for architectural analysis and construction.