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