pub trait Number:
Copy
+ Clone
+ Debug
+ Display
+ Default
+ Send
+ Sync
+ 'static {
const ZERO: Self;
const ONE: Self;
const TWO: Self;
const PI: Self;
Show 25 methods
// Required methods
fn from_i64(v: i64) -> Self;
fn from_f64(v: f64) -> Self;
fn from_scalar(s: Scalar) -> Self;
fn from_ratio(num: i64, den: i64) -> GeopResult<Self>;
fn to_f64(self) -> f64;
fn add(self, other: Self) -> Self;
fn sub(self, other: Self) -> Self;
fn mul(self, other: Self) -> Self;
fn neg(self) -> Self;
fn div(self, other: Self) -> GeopResult<Self>;
fn abs(self) -> Self;
fn sqrt(self) -> GeopResult<Self>;
fn sin(self) -> Self;
fn cos(self) -> Self;
fn acos(self) -> GeopResult<Self>;
fn could_be_equal(self, other: Self) -> bool;
fn definitely_not_equal(self, other: Self) -> bool;
fn could_be_greater(self, other: Self) -> bool;
fn definitely_greater(self, other: Self) -> bool;
fn could_be_less(self, other: Self) -> bool;
fn definitely_less(self, other: Self) -> bool;
fn is_sharp(self) -> bool;
fn is_exactly(self, other: Self) -> bool;
fn union(self, other: Self) -> Self;
// Provided method
fn degrees_to_radians(self) -> GeopResult<Self> { ... }
}Expand description
A number a residual computes with: a Scalar, giving the residual’s
value, or a crate::dual::Dual of one, giving its value and its
derivatives by the variables it depends on. Every residual is written
once, over T: Number, and evaluated with either. The comparisons act
on the value alone.
Required Associated Constants§
Required Methods§
fn from_i64(v: i64) -> Self
fn from_f64(v: f64) -> Self
Sourcefn from_scalar(s: Scalar) -> Self
fn from_scalar(s: Scalar) -> Self
The scalar s as a constant: depending on no variable.
fn from_ratio(num: i64, den: i64) -> GeopResult<Self>
fn add(self, other: Self) -> Self
fn sub(self, other: Self) -> Self
fn mul(self, other: Self) -> Self
fn neg(self) -> Self
Sourcefn div(self, other: Self) -> GeopResult<Self>
fn div(self, other: Self) -> GeopResult<Self>
Fails where the divisor could be zero.
fn abs(self) -> Self
fn sqrt(self) -> GeopResult<Self>
fn sin(self) -> Self
fn cos(self) -> Self
fn acos(self) -> GeopResult<Self>
fn could_be_equal(self, other: Self) -> bool
fn definitely_not_equal(self, other: Self) -> bool
fn could_be_greater(self, other: Self) -> bool
fn definitely_greater(self, other: Self) -> bool
fn could_be_less(self, other: Self) -> bool
fn definitely_less(self, other: Self) -> bool
Sourcefn is_sharp(self) -> bool
fn is_sharp(self) -> bool
Whether it is a single, exactly known point: a value that depends on no variable, and carries no width.
Sourcefn is_exactly(self, other: Self) -> bool
fn is_exactly(self, other: Self) -> bool
Whether its value is exactly other’s, as a set (see
Scalar::is_exactly).
Sourcefn union(self, other: Self) -> Self
fn union(self, other: Self) -> Self
The smallest value containing both (see Scalar::union).
Provided Methods§
Sourcefn degrees_to_radians(self) -> GeopResult<Self>
fn degrees_to_radians(self) -> GeopResult<Self>
The angle self, given in degrees, in radians.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".