Skip to main content

Module prelude

Module prelude 

Source

Re-exports§

pub use crate::catalan;

Structs§

Aabb2
An axis-aligned bounding box represented by inclusive minimum and maximum corners.
Angle
Explicit angle value stored in radians.
Bernoulli
A Bernoulli distribution with a single success probability.
Circle
A circle in 2D Euclidean space.
Complex
A complex number stored in rectangular form.
Differentiator
Finite-difference differentiation configuration.
Imaginary
A standalone imaginary value.
IntegrationInterval
A finite interval for definite integration.
Integrator
Numerical integration configuration.
LimitApproximator
Symmetric two-sided limit approximation settings.
Line2
An infinite 2D line represented by two sample points.
LinearVector2
A 2D column vector.
Matrix2
A 2×2 matrix stored in row-major order.
Point2
A 2D point represented with f64 coordinates.
Probability
A validated probability value in the closed interval [0, 1].
Rational
A normalized exact rational number.
Real
A validated finite f64 value.
RealInterval
A checked closed interval [min, max] over finite real values.
Segment2
A finite line segment between two 2D points.
Triangle
A constructed 2D triangle represented by three vertices.
Vector2
A 2D vector represented with f64 components.

Enums§

CalculusError
Errors returned by numerical-calculus helpers.
CatalanError
Errors returned by checked Catalan-family helpers.
CombinatoricsError
Errors returned by checked combinatorics helpers.
GeometryError
Errors returned by validated geometry constructors.
IntegerError
Errors produced by integer helper operations.
IntegerSign
Sign classification for a signed integer value.
LinearError
Errors returned by linear helpers when a system cannot be solved.
NumberCategory
Broad categories for raw f64 values.
NumberSign
Sign classes for raw numeric values that are not NaN.
Orientation2
The winding order of three 2D points.
ProbabilityError
Errors returned by validated probability helpers.
RationalError
Errors returned by validated rational-number helpers.
RealError
Errors returned by validated real-number helpers.
SeriesError
Errors returned by checked progression helpers.
StatisticsError
Errors returned by statistics helpers when the input cannot support the requested summary.

Constants§

GOLDEN_RATIO
The golden ratio as an f64.
GOLDEN_RATIO_F32
The golden ratio as an f32.
SQRT_3
The square root of three as an f64.
SQRT_3_F32
The square root of three as an f32.

Functions§

aabb_from_points
Creates a bounding box from any two corners.
approx_eq
Compares two real values with an explicit non-negative tolerance.
are_coprime
Returns whether two integers share no positive common divisor other than one.
are_disjoint
Returns whether left and right share no common members.
arithmetic_nth_term
Returns the zero-based indexth term of an arithmetic progression.
arithmetic_sum
Returns the sum of the first terms values of an arithmetic progression.
catalan
Returns the nth Catalan number using checked u128 arithmetic.
central_difference
Approximates the first derivative with a central difference.
classify_number
Classifies a raw f64 by floating-point category.
classify_number_sign
Classifies the sign of a raw f64 while keeping NaN explicit.
classify_sign
Classifies a signed integer as negative, zero, or positive.
combinations
Returns the number of unordered selections of size k from n items.
contains_member
Returns whether value is a member of set.
cos_deg
Evaluates cos for a degrees input.
degrees_to_radians
Converts a degrees value into radians.
distance_2d
Returns the Euclidean distance between two 2D points.
distance_squared_2d
Returns the squared Euclidean distance between two 2D points.
dot
Returns the dot product of two vectors.
equivalence
Returns whether two boolean values are logically equivalent.
exclusive_or
Returns the exclusive-or of two boolean values.
factorial
Returns n! using checked u128 arithmetic.
fuss_catalan
Returns the nth Fuss-Catalan number for a positive order.
gcd
Computes the non-negative greatest common divisor of two signed integers.
geometric_nth_term
Returns the zero-based indexth term of a geometric progression.
geometric_sum
Returns the sum of the first terms values of a geometric progression.
has_inverses
Commonly used facade items. Returns whether every value in elements has a two-sided inverse with respect to identity and operation.
identity_element
Commonly used facade items. Returns a two-sided identity element for operation, if one exists in elements.
implication
Returns the material implication left -> right.
independent_intersection
Returns the probability of two independent events both happening.
independent_union
Returns the probability of at least one of two independent events happening.
is_abelian_group
Commonly used facade items. Returns whether elements with operation form an abelian group.
is_associative
Commonly used facade items. Returns whether operation is associative over elements.
is_closed_under
Commonly used facade items. Returns whether applying operation to any pair of values in elements yields another member of elements.
is_commutative
Commonly used facade items. Returns whether operation is commutative over elements.
is_distributive_over
Commonly used facade items. Returns whether multiply distributes over add from both sides on elements.
is_divisible_by
Returns whether value is evenly divisible by divisor.
is_even
Returns whether an integer is evenly divisible by two.
is_finite_number
Returns whether a raw f64 is finite.
is_group
Commonly used facade items. Returns whether elements with operation form a group.
is_monoid
Commonly used facade items. Returns whether elements with operation form a monoid.
is_odd
Returns whether an integer leaves a remainder of one when divided by two.
is_ring
Commonly used facade items. Returns whether elements with add and multiply form a ring.
is_subset
Returns whether every unique value in left appears in right.
lcm
Computes the non-negative least common multiple of two signed integers.
majority
Returns whether at least two of three inputs are true.
mean
Returns the arithmetic mean of values.
median
Returns the median of values.
midpoint_2d
Returns the midpoint between two 2D points.
nand
Returns the NAND of two boolean values.
nor
Returns the NOR of two boolean values.
normalize_degrees
Normalizes a degrees value into the interval [0, 360).
normalize_radians
Normalizes a radians value into the interval [0, 2π).
orientation_2d
Returns the winding order of three 2D points.
orientation_2d_with_tolerance
Returns the winding order of three 2D points using an explicit area tolerance.
permutations
Returns the number of ordered selections of size k from n items.
population_std_dev
Returns the population standard deviation of values.
population_variance
Returns the population variance of values.
radians_to_degrees
Converts a radians value into degrees.
sample_std_dev
Returns the sample standard deviation of values using Bessel’s correction.
sample_variance
Returns the sample variance of values using Bessel’s correction.
second_central_difference
Approximates the second derivative with a central difference.
set_difference
Returns the unique members of left \ right in the order they first appear in left.
set_intersection
Returns the unique members of left ∩ right in the order they first appear in left.
set_symmetric_difference
Returns the unique members that appear in exactly one of left or right.
set_union
Returns the unique members of left ∪ right in first-seen order.
simpson_integral
Approximates a definite integral with Simpson’s rule.
sin_deg
Evaluates sin for a degrees input.
solve_2x2
Solves matrix * x = rhs for x.
symmetric_limit
Approximates a two-sided limit with one symmetric sample scale.
tan_deg
Evaluates tan for a degrees input.
trapezoidal_integral
Approximates a definite integral with the trapezoidal rule.
triangle_area
Returns the 2D triangle area.
triangle_twice_area
Returns twice the unsigned 2D triangle area.
triangle_twice_signed_area
Returns twice the signed 2D triangle area using the shoelace formula.
try_orientation_2d
Returns the winding order of three 2D points with finite coordinates.
try_orientation_2d_with_tolerance
Returns the winding order of three finite 2D points using an explicit area tolerance.