Development

Design-Core is built on a geometry engine centred around the Point class. As well as representing a 2D coordinate, Point provides a set of vector mathematics methods used throughout the codebase — in entity construction, snapping, trimming, dimension placement, and more.

This section documents the more advanced methods, explaining the underlying mathematics and describing where each is used within Design.


Vector Methods

Method

Summary

Dot Product

Scalar measure of how much two vectors point in the same direction. Returns positive, zero, or negative based on the angle between them.

Cross Product

Signed area of the parallelogram formed by two vectors. Indicates the turn direction (clockwise or counter-clockwise) from one vector to another.

Linear Interpolation (lerp)

Linear interpolation between two points at a fractional position \(t \in [0, 1]\) along the segment.

Rotate

Rotates a point about a centre by an angle in radians using the 2D rotation matrix.

Project

Moves a point along a bearing (angle in radians) by a given distance.

Perpendicular

Finds the foot of the perpendicular from a point onto an infinite line defined by two points.

Bulge

Scalar value stored on a polyline vertex that encodes an arc segment. Covers the sign convention, radius formula, and centre-point derivation.