Skip to content
jth41 edited this page Dec 12, 2015 · 1 revision

Here is an overview of the way classes inherit and aggregate for the Geometry Class Library or GCL for short. Every single class is intended to be immutable. That is, the only place properties or fields should be set is from within a constructor. Point is one of the most fundamental classes to GCL. Practically every other classes has a point, or points as internal fields. Ponts are very simple, internally we store a point's X, Y, and Z distance objects. The second most fundamental class is the Direction class. Directions are stored internally as two angles, phi and theta. That pair of angles determines a unique direction from the origin. We use the Physics convention for spherical coordinates to interpret these angles: https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/3D_Spherical.svg/240px-3D_Spherical.svg.png.

Lines are stored internally as a BasePoint and a Direction. Vectors derive from Line, but have an additional defining property magnitude. For two vectors to be considered equal, all 3 of these properties have to be the same. LineSegments derive from Vector. For linesegments, the above restriction is loosened. a segment that goes from point A to be Point B is considered equivalent to the segment from point B to Point A.