Struct calcify::ThreeField
source · [−]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());
Trait Implementations
Scale a ThreeField by a float from the other side.
type Output = ThreeField<'a>
type Output = ThreeField<'a>
The resulting type after applying the *
operator.
Scale a ThreeField by float.
type Output = ThreeField<'a>
type Output = ThreeField<'a>
The resulting type after applying the *
operator.
Negate a ThreeField.
type Output = ThreeField<'a>
type Output = ThreeField<'a>
The resulting type after applying the -
operator.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for ThreeField<'a>
impl<'a> !Send for ThreeField<'a>
impl<'a> !Sync for ThreeField<'a>
impl<'a> Unpin for ThreeField<'a>
impl<'a> !UnwindSafe for ThreeField<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more