pub struct ThreeField<'a> { /* private fields */ }
Expand description

Three dimensional scalar field

Implementations

Returns a new ThreeField

Arguments
  • func - &’a dyn Fn(&ThreeVec) -> f64
Example
use calcify::ThreeVec;
use calcify::ThreeField;
 
let g = ThreeField::new(&|tv: &ThreeVec| tv.r());
let g2: ThreeField = 2.0*g;

let test_vec = ThreeVec::new(2.0,2.0,2.0);

assert_eq!(g.loc(2.0,2.0,2.0),test_vec.r());
assert_eq!(g.at(test_vec),test_vec.r());
assert_eq!(g2.loc(2.0,2.0,2.0),2.0*test_vec.r());

Return value of field from three floats.

Return value of field at vector.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Scale a ThreeField by a float from the other side.

The resulting type after applying the * operator.

Scale a ThreeField by float.

The resulting type after applying the * operator.

Negate a ThreeField.

The resulting type after applying the - operator.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.