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

Three dimensional vector field

Implementations

Returns a new ThreeVecField

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

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

assert_eq!(g.loc(2.0,2.0,2.0),2.0*test_vec);
assert_eq!(g.at(test_vec),ThreeVec::new(4.0,4.0,4.0));
assert_eq!(g2.loc(2.0,2.0,2.0),ThreeVec::new(8.0,8.0,8.0));

Return value of field from three floats.

Return value of field from a ThreeVec

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Scale a ThreeVecField by float from the other side.

The resulting type after applying the * operator.

Scale a ThreeVecField by float.

The resulting type after applying the * operator.

Negate a ThreeVecField.

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.