Geometry typesThe core of euclid is a range of new primitive vector types modelling different types of geometries. When applicable, the types comes in both a 2 and 3 dimensional version. The vector types behaves much like regular R vectors in terms of subsetting, equality, etc. When it makes sense they also respond to arithmetic and sorting operations. 



Vector of geometries 

Query geometry class 
Vector of circles 

Vector of directions 

Vector of iso cubes 

Vector of iso rectangles 

Vector of lines 

Vector of planes 

Vector of points 

Vector of rays 

Vector of segments 

Vector of spheres 

Vector of tetrahedrons 

Vector of triangles 

Vector of vectors 

Vector of weighted points 

Other data typesIn addition to vectors of geometries euclid also provides a few other primitive types to support geometric operations. As with the vectors of geometries, these data types behaves much like normal R vectors. 

Exact numeric representation 

Create a vector of bounding boxes 


Create affine transformation matrices 
Data accessGeometries are based on parameters and sometimes supporting points. These can be extracted in various ways. 

Access the exact values that defines the geometries 

Extract points from geometries 

PredicatesAt the core of a lot of geometric algorithms lies predicates on geometries. This is also a place where floating points often leads to failures since e.g. a point constructed to lie on a plane may end up slightly off the plane due to rounding and imprecisions. The euclid predicates are exact, however, as long as the geometries have been constructed within the framework. 

Check if a geometry is degenerate 


Query location of points relative to geometry 

Check geometries for axis alignment 
Query whether geometries intersect 

Check geometries for parallelity 

Check geometries for whether they are collinear or coplanar 

Check whether points are collinear and ordered along the line 

Query the side of the turn constructed by three consecutive points 

TransformationsGeometries can be transformed by affine transformation matrices using the 

Project geometries to lines and planes 

Map 3D geometries to 2D based on plane 

Get the normal of a geometry 

IntersectionsIntersection of geometries is at the heart of many algorithms and is complicated by their unpredictable output type. Further, not all intersections can be represented exactly. 


Calculate intersections between geometries 
Query whether geometries intersect 

MeasuresMeasures on geometries such as area, length, and volume, cannot always be given in exact numbers due to reliance on square roots, pi, and other inexact operations. Because of this they are here provided as approximate measures in the sense that they are subjected to the imprecisions of floating point arithmetic. Further, pairwise measures such as distance is given as well. 


Approximate geometry measures 
Calculate distances between geometries 

Calculate angle between geometries 

LocationsSingle geometries or collections of them can define specific locations in space, often points, but also lines and planes. euclid provides a range of functionality for calculating these. 

Calculate the centroid of a geometry or a set of points 

Calculate circumcenter of triangles, tetrahedrons, or sets of points 

Calculate barycenter of a set of weighted points 

Calculate the bisector of two geometries 

Construct the equidistant line of 2 or three points 

Calculate radical point, line, or plane of two circles or spheres 