Geogram  Version 1.9.1
A programming library of geometric algorithms
geometry.h File Reference

Geometric functions in 2d and 3d. More...

Go to the source code of this file.

Classes

struct  GEO::Plane
 A 3D Plane. More...
 
class  GEO::Box
 Axis-aligned bounding box. More...
 
class  GEO::Box2d
 Axis-aligned bounding box. More...
 
struct  GEO::Ray
 A Ray, in parametric form. More...
 

Namespaces

 GEO
 Global Vorpaline namespace.
 
 GEO::Geom
 Geometric functions and utilities.
 

Typedefs

typedef vecng< 2, Numeric::float64 > GEO::vec2
 Represents points and vectors in 2d. More...
 
typedef vecng< 3, Numeric::float64 > GEO::vec3
 Represents points and vectors in 3d. More...
 
typedef vecng< 4, Numeric::float64 > GEO::vec4
 Represents points and vectors in 4d. More...
 
typedef vecng< 2, Numeric::float32 > GEO::vec2f
 Represents points and vectors in 2d with single-precision coordinates. More...
 
typedef vecng< 3, Numeric::float32 > GEO::vec3f
 Represents points and vectors in 3d with single-precision coordinates. More...
 
typedef vecng< 4, Numeric::float32 > GEO::vec4f
 Represents points and vectors in 4d with single-precision coordinates. More...
 
typedef vecng< 2, Numeric::int32 > GEO::vec2i
 Represents points and vectors in 2d with integer coordinates. More...
 
typedef vecng< 4, Numeric::int32 > GEO::vec4i
 Represents points and vectors in 4d with integer coordinates. More...
 
typedef Matrix< 2, Numeric::float64 > GEO::mat2
 Represents a 2x2 matrix. More...
 
typedef Matrix< 3, Numeric::float64 > GEO::mat3
 Represents a 3x3 matrix. More...
 
typedef Matrix< 4, Numeric::float64 > GEO::mat4
 Represents a 4x4 matrix. More...
 
typedef Box GEO::Box3d
 

Functions

double GEO::det (const mat2 &M)
 Computes the determinant of a 2x2 matrix. More...
 
vec3 GEO::Geom::barycenter (const vec3 &p1, const vec3 &p2)
 Computes the barycenter of two points in 3d. More...
 
vec3 GEO::Geom::barycenter (const vec3 &p1, const vec3 &p2, const vec3 &p3)
 Computes the barycenter of three points in 3d. More...
 
double GEO::Geom::cos_angle (const vec3 &a, const vec3 &b)
 Computes the cosine of the angle between two 3d vectors. More...
 
double GEO::Geom::angle (const vec3 &a, const vec3 &b)
 Computes the angle between two 3d vectors. More...
 
double GEO::Geom::det (const vec2 &a, const vec2 &b)
 Computes the determinant of two vectors. More...
 
vec3 GEO::Geom::triangle_normal (const vec3 &p1, const vec3 &p2, const vec3 &p3)
 Computes the normal of a 3d triangle. More...
 
double GEO::Geom::triangle_area_3d (const double *p1, const double *p2, const double *p3)
 Computes the area of a 3d triangle. More...
 
double GEO::Geom::triangle_area (const vec3 &p1, const vec3 &p2, const vec3 &p3)
 Computes the area of a 3d triangle. More...
 
double GEO::Geom::triangle_signed_area_2d (const double *p1, const double *p2, const double *p3)
 Computes the area of a 2d triangle. More...
 
double GEO::Geom::triangle_signed_area (const vec2 &p1, const vec2 &p2, const vec2 &p3)
 Computes the area of a 2d triangle. More...
 
double GEO::Geom::triangle_area_2d (const double *p1, const double *p2, const double *p3)
 Computes the area of a 2d triangle. More...
 
vec2 GEO::Geom::triangle_circumcenter (const vec2 &p1, const vec2 &p2, const vec2 &p3)
 Computes the center of the circumscribed circle of a 2d triangle. More...
 
bool GEO::Geom::has_nan (const vec3 &v)
 Tests whether a 3d vector has a NaN (not a number) coordinate. More...
 
vec3 GEO::Geom::perpendicular (const vec3 &V)
 Computes a 3d vector orthogonal to another one. More...
 
double GEO::Geom::tetra_signed_volume (const vec3 &p1, const vec3 &p2, const vec3 &p3, const vec3 &p4)
 Computes the signed volume of a 3d tetrahedron. More...
 
double GEO::Geom::tetra_signed_volume (const double *p1, const double *p2, const double *p3, const double *p4)
 Computes the signed volume of a 3d tetrahedron. More...
 
double GEO::Geom::tetra_volume (const vec3 &p1, const vec3 &p2, const vec3 &p3, const vec3 &p4)
 Computes the volume of a 3d tetrahedron. More...
 
vec3 GEO::Geom::tetra_circum_center (const vec3 &p1, const vec3 &p2, const vec3 &p3, const vec3 &p4)
 Computes the center of the circumscribed sphere of 3d tetrahedron. More...
 
void GEO::Geom::triangle_centroid (const vec3 &p, const vec3 &q, const vec3 &r, double a, double b, double c, vec3 &Vg, double &V)
 Computes the centroid of a 3d triangle with weighted points. More...
 
double GEO::Geom::triangle_mass (const vec3 &p, const vec3 &q, const vec3 &r, double a, double b, double c)
 Computes the mass of a 3d triangle with weighted points. More...
 
vec3 GEO::Geom::random_point_in_triangle (const vec3 &p1, const vec3 &p2, const vec3 &p3)
 Generates a random point in a 3d triangle. More...
 
bool GEO::bboxes_overlap (const Box &B1, const Box &B2)
 Tests whether two Boxes have a non-empty intersection. More...
 
void GEO::bbox_union (Box &target, const Box &B1, const Box &B2)
 Computes the smallest Box that encloses two Boxes. More...
 
bool GEO::bboxes_overlap (const Box2d &B1, const Box2d &B2)
 Tests whether two Box2d have a non-empty intersection. More...
 
void GEO::bbox_union (Box2d &target, const Box2d &B1, const Box2d &B2)
 Computes the smallest Box2d that encloses two Box2d. More...
 
template<class FT >
vecng< 3, FT > GEO::transform_vector (const vecng< 3, FT > &v, const Matrix< 4, FT > &m)
 Applies a 3d transform to a 3d vector. More...
 
template<class FT >
vecng< 3, FT > GEO::transform_point (const vecng< 3, FT > &v, const Matrix< 4, FT > &m)
 Applies a 3d transform to a 3d point. More...
 
template<class FT >
vecng< 3, FT > GEO::transform_point (const Matrix< 4, FT > &m, const vecng< 3, FT > &v)
 Applies a 3d transform to a 3d point. More...
 
template<class FT >
vecng< 4, FT > GEO::transform_vector (const vecng< 4, FT > &v, const Matrix< 4, FT > &m)
 Applies a 4d transform to a 4d point. More...
 
mat4 GEO::create_translation_matrix (const vec3 &T)
 Creates a translation matrix from a vector. More...
 
mat4 GEO::create_scaling_matrix (double s)
 Creates a scaling matrix. More...
 

Detailed Description

Geometric functions in 2d and 3d.

Definition in file geometry.h.