geogebra_types

Struct Numeric

source
pub struct Numeric(/* private fields */);
Expand description

A number value

Implementations§

source§

impl Numeric

source

pub fn is_const(&self) -> bool

Check if this numeric is a constant

source

pub fn distance<T: Object>(point: impl Into<Point>, object: T) -> Self

Distance between a point and an object

source

pub fn complex(real: impl Into<Numeric>, imaginary: impl Into<Numeric>) -> Self

A complex number

source

pub fn angle( a: impl Into<Point>, b: impl Into<Point>, c: impl Into<Point>, ) -> Self

An angle defined by three points

source

pub fn angle_lines(k: impl Into<Line>, l: impl Into<Line>) -> Self

Angle between two lines

source

pub fn atan2(y: impl Into<Numeric>, x: impl Into<Numeric>) -> Self

atan2 function

source

pub fn pow(self, exponent: impl Into<Numeric>) -> Self

Raise this number to a power.

source

pub fn real(self) -> Self

Get the real part of this number

source

pub fn imaginary(self) -> Self

Get the imaginary part of this number

source

pub fn arg(self) -> Self

Get the argument of a complex number.

Trait Implementations§

source§

impl<T: Into<Numeric>> Add<T> for Numeric

source§

type Output = Numeric

The resulting type after applying the + operator.
source§

fn add(self, rhs: T) -> Self::Output

Performs the + operation. Read more
source§

impl<T: Into<Numeric>> AddAssign<T> for Numeric

source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
source§

impl Bounded for Numeric

source§

fn min_value() -> Self

Returns the smallest finite number this type can represent
source§

fn max_value() -> Self

Returns the largest finite number this type can represent
source§

impl Clone for Numeric

source§

fn clone(&self) -> Numeric

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Into<Numeric>> Div<T> for Numeric

source§

type Output = Numeric

The resulting type after applying the / operator.
source§

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
source§

impl<T: Into<Numeric>> DivAssign<T> for Numeric

source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
source§

impl Expr for Numeric

source§

type Target = Numeric

Target primitive type.
source§

fn get_type() -> ElementType

Get the element type of this expression
source§

fn var(expr: String) -> Var<Self::Target>

Create a variable of target type
source§

impl From<&Numeric> for Numeric

source§

fn from(value: &Self) -> Self

Converts to this type from the input type.
source§

impl<T: Copy + Into<Numeric>> From<&T> for Numeric

source§

fn from(value: &T) -> Self

Converts to this type from the input type.
source§

impl From<&Var<Numeric>> for Numeric

source§

fn from(value: &Var<Numeric>) -> Self

Converts to this type from the input type.
source§

impl From<Numeric> for Expression

source§

fn from(value: Numeric) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Numeric

source§

fn from(value: f64) -> Self

Converts to this type from the input type.
source§

impl<T: Into<Numeric>> Mul<T> for Numeric

source§

type Output = Numeric

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
source§

impl<T: Into<Numeric>> MulAssign<T> for Numeric

source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
source§

impl Neg for Numeric

source§

type Output = Numeric

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl Num for Numeric

source§

type FromStrRadixErr = &'static str

source§

fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>

Convert from a string and radix (typically 2..=36). Read more
source§

impl One for Numeric

source§

fn is_one(&self) -> bool

WARNING: This is not necessarily always precise

source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
source§

impl<T> PartialEq<T> for Numeric
where Numeric: for<'a> From<&'a T>,

source§

fn eq(&self, other: &T) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Into<Numeric>> Rem<T> for Numeric

source§

type Output = Numeric

The resulting type after applying the % operator.
source§

fn rem(self, rhs: T) -> Self::Output

Performs the % operation. Read more
source§

impl<T: Into<Numeric>> RemAssign<T> for Numeric

source§

fn rem_assign(&mut self, rhs: T)

Performs the %= operation. Read more
source§

impl<T: Into<Numeric>> Sub<T> for Numeric

source§

type Output = Numeric

The resulting type after applying the - operator.
source§

fn sub(self, rhs: T) -> Self::Output

Performs the - operation. Read more
source§

impl<T: Into<Numeric>> SubAssign<T> for Numeric

source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more
source§

impl Zero for Numeric

source§

fn is_zero(&self) -> bool

WARNING: This is not necessarily always precise

source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> LowerBounded for T
where T: Bounded,

source§

fn min_value() -> T

Returns the smallest finite number this type can represent
source§

impl<T> NumericAccess for T
where Numeric: From<T>,

source§

fn pow(self, exponent: impl Into<Numeric>) -> Numeric

Raise the number to a power
source§

fn real(self) -> Numeric

Get the real part of this number
source§

fn imaginary(self) -> Numeric

Get the imaginary part of this number
source§

fn arg(self) -> Numeric

Get this complex number’s argument
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UpperBounded for T
where T: Bounded,

source§

fn max_value() -> T

Returns the largest finite number this type can represent
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> NumAssign for T
where T: Num + NumAssignOps,

source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T> NumAssignRef for T
where T: NumAssign + for<'r> NumAssignOps<&'r T>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

source§

impl<T> NumRef for T
where T: Num + for<'r> NumOps<&'r T>,

source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,