37 #ifndef H_OGF_BASIC_MATH_GEOMETRY_H
38 #define H_OGF_BASIC_MATH_GEOMETRY_H
92 result[i] += w[j] * m(j,i) ;
97 result[0] / result[3],
123 xy_min_[c] = xy_max_[c] = p[c];
127 xy_min_[c] = std::min(xy_min_[c],p[c]);
128 xy_max_[c] = std::max(xy_max_[c],p[c]);
152 return initialized_ ? (xy_max_[0] - xy_min_[0]) : 0.0;
160 return initialized_ ? (xy_max_[1] - xy_min_[1]) : 0.0;
221 initialized_ =
false;
262 Box::xyz_min[c] = std::min(Box::xyz_min[c],p[c]);
263 Box::xyz_max[c] = std::max(Box::xyz_max[c],p[c]);
267 Box::xyz_min[c] = Box::xyz_max[c] = p[c];
294 result[c] = 0.5*(Box::xyz_min[c] + Box::xyz_max[c]);
307 result += ogf_sqr(Box::xyz_max[c] - Box::xyz_min[c]);
309 return 0.5*::sqrt(result);
382 initialized_ =
false;
Axis-aligned bounding box.
void add_box(const Box2d &B)
Adds a box to this Box2d.
double x_min() const
Gets the minimum x coordinate in this box.
double y_max() const
Gets the maximum y coordinate in this box.
double y_min() const
Gets the minimum y coordinate in this box.
double width() const
Gets the width of this box.
bool initialized() const
Tests whether the box is initialized.
double height() const
Gets the height of this box.
double x_max() const
Gets the maximum x coordinate in this box.
void add_point(const vec2 &p)
Adds a point to this Box2d.
Box2d()
Constructs a new uninitialized Box2d.
void clear()
Clears the box.
void add_box(const Box3d &B)
Adds a box to this Box3d.
double radius() const
Gets the radius of this Box3d.
void add_point(const vec3 &p)
Adds a point to this Box3d.
bool initialized() const
Tests whether the box is initialized.
double x_min() const
Gets the minimum x coordinate in this box.
double z_min() const
Gets the minimum z coordinate in this box.
double y_min() const
Gets the minimum y coordinate in this box.
double y_max() const
Gets the maximum y coordinate in this box.
Box3d()
Constructs a new uninitialized Box3d.
void clear()
Clears the box.
double z_max() const
Gets the maximum z coordinate in this box.
double x_max() const
Gets the maximum x coordinate in this box.
vec3 center() const
Gets the center of this Box3d.
Geometric functions in 2d and 3d.
Geometric functions and utilities.
vecng< 3, Numeric::float64 > vec3
Represents points and vectors in 3d.
geo_index_t index_t
The type for storing and manipulating indices.
vecng< 2, Numeric::float64 > vec2
Represents points and vectors in 2d.
Global Graphite namespace.
vecng< 2, FT > transform_point(const vecng< 2, FT > &v, const Matrix< 4, FT > &m)
Applies a 3d transform to a 2d point.
Definitions common to all include files in the basic library.