Skip to main content

Crate ogeom_math

Crate ogeom_math 

Source
Expand description

Value-semantics geometric primitives and the numerical machinery under them.

Elsewhere: the gp primitives, the B-spline basis libraries, elementary curve/surface parameterization, and the solver half of a math package.

Two things here are load-bearing and easy to get wrong:

  • Dir enforces its unit-length invariant in the type, not by convention.
  • Trsf carries a form classification (identity / translation / rotation / scale / …), used to short-circuit transform application. Skipping it costs real performance across the whole kernel.

Re-exports§

pub use bounds::Aabb;
pub use bspline::Blend;
pub use bspline::ControlGrid;
pub use bspline::Weighted;
pub use conic::Circle;
pub use conic::Circle2;
pub use conic::Ellipse;
pub use conic::Ellipse2;
pub use conic::Hyperbola;
pub use conic::Hyperbola2;
pub use conic::Parabola;
pub use conic::Parabola2;
pub use construct2d::Bisector2;
pub use construct2d::Placement;
pub use construct2d::TangentCircle;
pub use construct2d::Target2;
pub use construct2d::bisector;
pub use construct2d::circles_of_radius_tangent_to_two;
pub use construct2d::circles_tangent_to_three;
pub use construct2d::lines_tangent_to_two_circles;
pub use direction::Direction;
pub use direction::Direction2;
pub use elementary::CurvePoint;
pub use elementary::SurfacePoint;
pub use frame::Axis;
pub use frame::Axis2;
pub use frame::Frame;
pub use frame::Frame2;
pub use frame::Handedness;
pub use integrate::gauss_kronrod;
pub use integrate::gauss_legendre;
pub use integrate::gauss_legendre_rule;
pub use integrate::integrate;
pub use integrate::integrate_2d;
pub use interval::Interval;
pub use knots::BasisValues;
pub use knots::KnotVector;
pub use matrix::Matrix2;
pub use matrix::Matrix3;
pub use optimize::Minimum;
pub use optimize::global_minimum;
pub use optimize::minimize_local;
pub use optimize::swarm_minimum;
pub use point::Point;
pub use point::Point2;
pub use quadric::Cone;
pub use quadric::Cylinder;
pub use quadric::Plane;
pub use quadric::Sphere;
pub use quadric::Torus;
pub use quadric::TorusKind;
pub use quaternion::Quaternion;
pub use solve::Convergence;
pub use solve::Criteria;
pub use solve::Solution;
pub use solve::SystemSolution;
pub use sparse::SparseMatrix;
pub use sparse::least_squares_cgnr;
pub use transform::GeneralTransform;
pub use transform::Transform;
pub use transform::Transform2;
pub use transform::TransformKind;
pub use vector::Vector;
pub use vector::Vector2;

Modules§

bounds
Axis-aligned bounding boxes.
bspline
B-spline algorithms over control points: evaluation, refinement, elevation.
conic
Conic sections: circle, ellipse, hyperbola, parabola.
construct2d
The classical 2D constructions: circles tangent to three entities, tangent lines, and bisector curves: the straightedge-and-compass repertoire, solved algebraically.
direction
Unit vectors, with the invariant enforced by the type.
elementary
Parameterization of the analytic primitives.
frame
Axes and coordinate frames.
integrate
Numerical integration.
interval
Interval arithmetic for filtered predicates.
knots
Knot vectors and B-spline basis functions.
matrix
Small dense matrices: the linear part of a transform.
optimize
Minima of functions of several variables over a box: local, and global.
point
Positions in 2D and 3D.
quadric
Elementary surfaces: plane, cylinder, cone, sphere, torus.
quaternion
Unit quaternions for rotation.
solve
Root finding, polynomial roots and minimization.
sparse
Sparse linear algebra: a compressed-sparse-row matrix and the conjugate gradient least-squares solver built on it.
transform
Rigid and similarity transforms, and general affine transforms.
vector
Free vectors in 2D and 3D.