Skip to main content

use_math/
lib.rs

1#![forbid(unsafe_code)]
2#![doc = include_str!("../README.md")]
3
4//! Utility-first facade for `RustUse` math crates.
5
6#[cfg(feature = "algebra")]
7pub use use_algebra as algebra;
8
9#[cfg(feature = "algebra")]
10pub use use_algebra::{
11    has_inverses, identity_element, is_abelian_group, is_associative, is_closed_under,
12    is_commutative, is_distributive_over, is_group, is_monoid, is_ring,
13};
14
15#[cfg(feature = "calculus")]
16pub use use_calculus as calculus;
17
18#[cfg(feature = "calculus")]
19pub use use_calculus::{
20    CalculusError, Differentiator, IntegrationInterval, Integrator, LimitApproximator,
21    central_difference, second_central_difference, simpson_integral, symmetric_limit,
22    trapezoidal_integral,
23};
24
25#[cfg(feature = "catalan")]
26pub use use_catalan as catalan;
27
28#[cfg(feature = "catalan")]
29pub use use_catalan::{CatalanError, catalan, fuss_catalan};
30
31#[cfg(feature = "combinatorics")]
32pub use use_combinatorics as combinatorics;
33
34#[cfg(feature = "combinatorics")]
35pub use use_combinatorics::{CombinatoricsError, combinations, factorial, permutations};
36
37#[cfg(feature = "complex")]
38pub use use_complex as complex;
39
40#[cfg(feature = "complex")]
41pub use use_complex::{Complex, Imaginary};
42
43#[cfg(feature = "geometry")]
44pub use use_geometry as geometry;
45
46#[cfg(feature = "geometry")]
47pub use use_geometry::{
48    Aabb2, Circle, GeometryError, Line2, Orientation2, Point2, Segment2, Triangle, Vector2,
49    aabb_from_points, distance_2d, distance_squared_2d, midpoint_2d, orientation_2d,
50    orientation_2d_with_tolerance, triangle_area, triangle_twice_area, triangle_twice_signed_area,
51    try_orientation_2d, try_orientation_2d_with_tolerance,
52};
53
54#[cfg(feature = "geode")]
55pub mod geode {
56    pub use use_geode::*;
57}
58
59#[cfg(feature = "geode")]
60pub use use_geode::{
61    GeodeError, TypeVector, catalan_from_geode_dimension, checked_factorial,
62    checked_product_factorials, diagonal_geode_2d, diagonal_geode_3d, diagonal_geode_4d,
63    exact_divide, face_count, geode_memoized, geode_on_first_axis, hyper_catalan,
64    polygon_edge_count, polygon_vertex_count,
65};
66
67#[cfg(feature = "integer")]
68pub use use_integer as integer;
69
70#[cfg(feature = "integer")]
71pub use use_integer::{
72    IntegerError, IntegerSign, are_coprime, classify_sign, gcd, is_divisible_by, is_even, is_odd,
73    lcm,
74};
75
76#[cfg(feature = "linear")]
77pub use use_linear as linear;
78
79#[cfg(feature = "linear")]
80pub use use_linear::{LinearError, Matrix2, Vector2 as LinearVector2, dot, solve_2x2};
81
82#[cfg(feature = "logic")]
83pub use use_logic as logic;
84
85#[cfg(feature = "logic")]
86pub use use_logic::{equivalence, exclusive_or, implication, majority, nand, nor};
87
88#[cfg(feature = "number")]
89pub use use_number as number;
90
91#[cfg(feature = "number")]
92pub use use_number::{
93    GOLDEN_RATIO, GOLDEN_RATIO_F32, NumberCategory, NumberSign, SQRT_3, SQRT_3_F32,
94    classify_number, classify_number_sign, is_finite_number,
95};
96
97#[cfg(feature = "probability")]
98pub use use_probability as probability;
99
100#[cfg(feature = "probability")]
101pub use use_probability::{
102    Bernoulli, Probability, ProbabilityError, independent_intersection, independent_union,
103};
104
105#[cfg(feature = "rational")]
106pub use use_rational as rational;
107
108#[cfg(feature = "rational")]
109pub use use_rational::{Rational, RationalError};
110
111#[cfg(feature = "real")]
112pub use use_real as real;
113
114#[cfg(feature = "real")]
115pub use use_real::{Real, RealError, RealInterval, approx_eq};
116
117#[cfg(feature = "series")]
118pub use use_series as series;
119
120#[cfg(feature = "series")]
121pub use use_series::{
122    SeriesError, arithmetic_nth_term, arithmetic_sum, geometric_nth_term, geometric_sum,
123};
124
125#[cfg(feature = "set")]
126pub use use_set as set;
127
128#[cfg(feature = "set")]
129pub use use_set::{
130    are_disjoint, contains_member, is_subset, set_difference, set_intersection,
131    set_symmetric_difference, set_union,
132};
133
134#[cfg(feature = "statistics")]
135pub use use_statistics as statistics;
136
137#[cfg(feature = "statistics")]
138pub use use_statistics::{
139    StatisticsError, mean, median, population_std_dev, population_variance, sample_std_dev,
140    sample_variance,
141};
142
143#[cfg(feature = "trigonometry")]
144pub use use_trigonometry as trigonometry;
145
146#[cfg(feature = "trigonometry")]
147pub use use_trigonometry::{
148    Angle, cos_deg, degrees_to_radians, normalize_degrees, normalize_radians, radians_to_degrees,
149    sin_deg, tan_deg,
150};
151
152pub mod prelude;