Initializing 3D Canvas...

The Point

1 min read1 page

The Infinite Zero

The fundamental building block of all geometry, yet paradoxically, it has no physical dimensions. It has no length, no width, and no depth. It is purely a coordinate, an absolute location in space.

If you strip away the textures, the mesh faces, and the wireframe edges of any complex 3D model, you are left with its purest structural essence: a vast array of points existing silently in a coordinate system.
2 min read1 page

The Relationship to Vectors

A vector is a collection of numbers representing pure direction and magnitude [X, Y, Z]. It floats freely without location.

A Point, geometrically, can be thought of as a Vector that is strictly anchored to the Origin (0,0,0). When you evaluate the coordinates (X, Y, Z), you are essentially measuring the vector required to travel from the Origin to that absolute location.

The Abstract Singularity: An algorithmic point is not a dot drawn on a screen. It is an abstract data type.

The Pure Data Structure

At its core, a point is stored in memory as an ordered list of three double-precision floating-point numbers (X, Y, Z).

python
1class Point3d:
2 def __init__(self, x: float, y: float, z: float):
3 self.X = float(x)
4 self.Y = float(y)
5 self.Z = float(z)
6
7 def __str__(self):
8 return f"Point3d({self.X}, {self.Y}, {self.Z})"
9
10 @classmethod
11 def Origin(cls):
12 """Gets the point at (0,0,0)."""
13 return cls(0.0, 0.0, 0.0)

Point3d~=Vector3d

The math behind it is exactly the same.

1 min read1 page

DistanceTo(Point3d):

Calculates the absolute Euclidean distance between two points.
python
1import math
2
3class Point3d:
4 def DistanceTo(self, other: 'Point3d') -> float:
5 """Returns the distance between two points."""
6 dx, dy, dz = other.X - self.X, other.Y - self.Y, other.Z - self.Z
7 return math.sqrt(dx**2 + dy**2 + dz**2)
X
3.00
Y
-4.00
Z
0.00

VectorTo(Point3d):

Returns the vector from this point to another point.
2 min read1 page

DistanceToSquared(Point3d):

Calculates the square of the distance between two points. This is purely a performance optimization.
python
1import math
2
3class Point3d:
4 def DistanceTo(self, other: 'Point3d') -> float:
5 # EXPENSIVE: math.sqrt is a heavy operation
6 dx = self.X - other.X
7 dy = self.Y - other.Y
8 dz = self.Z - other.Z
9 return math.sqrt(dx**2 + dy**2 + dz**2)
10
11 def DistanceToSquared(self, other: 'Point3d') -> float:
12 # CHEAP: No square root required
13 dx = self.X - other.X
14 dy = self.Y - other.Y
15 dz = self.Z - other.Z
16 return dx**2 + dy**2 + dz**2

Square roots (math.sqrt) are computationally expensive. When writing algorithms like `ClosestPoint` that compare thousands of distances to find the smallest one, we don't need the actual distance, we just need to know which one is relatively smaller.


If A < B, then A² < B². Using DistanceToSquared inside loops saves significant processing time.

Move B (X)
3.00
1 min read1 page

Subtract(Point3d):

Subtracting Point A from Point B yields a Vector that represents the direction and distance from A to B. This is the fundamental link between points and vectors.
python
1class Point3d:
2 def Subtract(self, other: 'Point3d') -> 'Vector3d':
3 """Subtracting a point from another point yields a Vector."""
4 # Note that the result is a Vector3d, not a Point3d
5 return Vector3d(
6 self.X - other.X,
7 self.Y - other.Y,
8 self.Z - other.Z
9 )
This uses Vector logic. Brush up on the Vector article if needed.
Point B (X)
3.00
Point B (Y)
-1.60
2 min read1 page

Interpolate(Point3d, float):

Linearly interpolates between two points. This is exactly how you find a point along a line segment at a specific parameter `t`.
python
1class Point3d:
2 def Interpolate(self, other: 'Point3d', t: float) -> 'Point3d':
3 """Finds a point between self and other based on parameter t."""
4 # t = 0.0 returns self
5 # t = 1.0 returns other
6 # t = 0.5 returns the midpoint
7
8 return Point3d(
9 self.X + (other.X - self.X) * t,
10 self.Y + (other.Y - self.Y) * t,
11 self.Z + (other.Z - self.Z) * t
12 )
Parameter (t)
0.50
1 min read1 page

Move(Vector3d):

Translation is the simple addition of a vector to a point's coordinates. It shifts the location of the point through space.
python
1class Point3d:
2 def Move(self, vector: 'Vector3d') -> 'Point3d':
3 """Translates the point by adding a vector."""
4 return Point3d(self.X + vector.X, self.Y + vector.Y, self.Z + vector.Z)
X
-3.00
Y
2.00
This is identical to vector Addition
1 min read1 page

Scale(float):

Scaling a point does not make the point bigger. Instead, scaling changes the point's distance from a center of scaling (usually the Origin). Scaling by 2.0 doubles the length of the vector connecting the Origin to the Point.
python
1class Point3d:
2 def Scale(self, scale_factor: float) -> 'Point3d':
3 """Scales the point relative to the origin."""
4 return Point3d(self.X * scale_factor, self.Y * scale_factor, self.Z * scale_factor)
This is identical to vector Multiplication
Scale
2.00
3 min read1 page

Rotate(Axis3d, float):

Rotating a point swings its coordinate vector in an arc around a specific center point and axis.
python
1import math
2
3class Point3d:
4 def Rotate(self, axis: 'Vector3d', angle_degrees: float) -> 'Point3d':
5 """Rotates the point around the given axis."""
6 angle_rad = math.radians(angle_degrees)
7 cos_a = math.cos(angle_rad)
8 sin_a = math.sin(angle_rad)
9
10 ux, uy, uz = axis.X, axis.Y, axis.Z
11
12 # Rodrigues' rotation formula applied to the position vector
13 x_new = self.X * (cos_a + ux*ux*(1-cos_a)) + self.Y * (ux*uy*(1-cos_a) - uz*sin_a) + self.Z * (ux*uz*(1-cos_a) + uy*sin_a)
14 y_new = self.X * (uy*ux*(1-cos_a) + uz*sin_a) + self.Y * (cos_a + uy*uy*(1-cos_a)) + self.Z * (uy*uz*(1-cos_a) - ux*sin_a)
15 z_new = self.X * (uz*ux*(1-cos_a) - uy*sin_a) + self.Y * (uz*uy*(1-cos_a) + ux*sin_a) + self.Z * (cos_a + uz*uz*(1-cos_a))
16
17 return Point3d(x_new, y_new, z_new)
Angle
90.00
1 min read1 page

FindClosestPoint(Point3d, list[Point3d]):

Finding the closest point in a large collection is a fundamental search operation.
python
1def FindClosestPoint(test_pt: Point3d, cloud: list[Point3d]) -> Point3d:
2 """Brute force search for the closest point."""
3 closest = cloud[0]
4 min_dist = test_pt.DistanceTo(closest)
5
6 for pt in cloud:
7 d = test_pt.DistanceTo(pt)
8 if d < min_dist:
9 min_dist = d
10 closest = pt
11 return closest
While we can check every point (Brute Force), complex systems use Spatial Trees (like R-Trees or KD-Trees) to make this nearly instantaneous.
Test Point X
2.00
Test Point Y
2.00
2 min read1 page

Centroid(list[Point3d]):

Calculates the average center (centroid) of a list of points.
python
1def Centroid(points: list[Point3d]) -> Point3d:
2 """Calculates the arithmetic average of a list of points."""
3 n = len(points)
4 if n == 0:
5 return None
6
7 cx = sum(p.X for p in points) / n
8 cy = sum(p.Y for p in points) / n
9 cz = sum(p.Z for p in points) / n
10
11 return Point3d(cx, cy, cz)
The centroid is the arithmetic mean position of all the points in the set. It represents the perfect geometric center of a point cloud.
P1 X Offset
-2.50
P2 Y Offset
3.00
2 min read1 page

WeightedCenter(list[Point3d], list[float]):

Calculates a single center point from multiple points, influenced by the 'weight' of each point.
python
1def WeightedCenter(points: list[Point3d], weights: list[float]) -> Point3d:
2 """Calculates the center of mass based on point weights."""
3 total_weight = sum(weights)
4
5 if total_weight == 0:
6 return None
7
8 cx = sum(p.X * w for p, w in zip(points, weights)) / total_weight
9 cy = sum(p.Y * w for p, w in zip(points, weights)) / total_weight
10 cz = sum(p.Z * w for p, w in zip(points, weights)) / total_weight
11
12 return Point3d(cx, cy, cz)
Unlike a simple average (centroid), a weighted center pulls the result closer to points with higher weight values. This is essential for structural load distribution, centroid of non-uniform point clouds, and attractor systems.
Weight 1 (Top Left)
1.00
Weight 2 (Top Right)
1.00
Weight 3 (Bottom Left)
1.00
Weight 4 (Bottom Right)
1.00
Weight 5 (Center)
5.00
2 min read1 page

DistanceToPlane(Plane):

Calculates the signed distance from a point to a plane.
python
1def DistanceToPlane(point: Point3d, plane_origin: Point3d, plane_normal: Vector3d) -> float:
2 """Calculates the signed distance from a point to a plane."""
3 # Vector from plane origin to the test point
4 v = point - plane_origin
5
6 # Project the vector onto the plane normal
7 # Ensure normal is unitized
8 n = Vector3d(plane_normal)
9 n.Unitize()
10
11 # Signed distance is the dot product
12 return v * n
The signed distance is positive if the point lies in the direction of the plane normal, and negative if it lies on the opposite side.
Point Z Height
3.00
1 min read1 page

ProjectTo(Plane):

Projects a 3D point orthogonally onto a mathematical plane.
python
1def ProjectToPlane(point: Point3d, plane_origin: Point3d, plane_normal: Vector3d) -> Point3d:
2 # Get signed distance to plane
3 d = DistanceToPlane(point, plane_origin, plane_normal)
4
5 # Shift point back along normal
6 return point - plane_normal * d
Unlike finding the closest point in a scattered cloud of points, this operation drops a point perfectly perpendicular onto a flat infinite surface. This is heavily used for flattening 3D models into 2D plans, shadow casting, and preparing geometry for laser cutting. It forms a bridge to The Plane article.
Point X
1.50
Point Y
-1.50
Point Z
3.00
Plane Tilt (deg)
15.00
1 min read1 page

IsOnPlane(Plane):

Checks if a point lies on a plane within a given tolerance.
python
1def IsOnPlane(point: Point3d, plane_origin: Point3d, plane_normal: Vector3d, tolerance: float = 1e-6) -> bool:
2 """Checks if a point lies on a plane within a tolerance."""
3 dist = DistanceToPlane(point, plane_origin, plane_normal)
4 return abs(dist) <= tolerance
Because of floating-point inaccuracies, points are rarely exactly on a plane. We check if their perpendicular distance is less than or equal to a tiny tolerance.
Point Z Height
0.05
1 min read1 page

Transform(Transform):

Applies a 4x4 Transformation Matrix to a point, modifying its position in space.
python
1# 1. Create a matrix (e.g. translation)
2xform = Transform.Translation(1.5, 2.0, 3.0)
3
4# 2. Apply it to the point (modifies in place)
5pt.Transform(xform)
While methods like Translate, Scale, and Rotate are convenient, under the hood they all generate a 4x4 Matrix and pass it to this master Transform method.
Matrix Tx
2.00
Matrix Ty
1.00
Matrix Tz
-1.00
This is the critical bridge to The Matrix article. By bundling complex sequences of moves, rotations, and scales into a single matrix, you can transform millions of points instantly on the GPU.
1 min read1 page

3 Applications

A single point can act as an attractor or repeller in a generative system. By calculating the distance vector between the attractor point and a grid of other objects, we can scale or move the objects based on their proximity, producing organic, non-uniform distributions.

python
1# Attractor Logic
2for obj_pt in grid:
3 dist = attractor.DistanceTo(obj_pt)
4 if dist < threshold:
5 # Scale based on proximity
6 obj.Scale(1.0 / dist)
X
0.00
Y
0.00