[−][src]Trait building_blocks::prelude::Point
A trait that bundles op traits that all PointN<N>
(and its components) should have.
Associated Types
Loading content...Required methods
fn basis() -> Vec<Self>
fn abs(&self) -> Self
Returns a point where each component is the absolute value of the input component.
fn at(&self, component_index: usize) -> Self::Scalar
Returns the component specified by index. I.e. X = 0, Y = 1, Z = 2.
fn map_components(&self, f: impl Fn(Self::Scalar) -> Self::Scalar) -> Self
Returns the point after applying f
component-wise.
Implementors
impl Point for PointN<[f32; 2]>
[src]
type Scalar = f32
pub fn basis() -> Vec<PointN<[f32; 2]>>
[src]
pub fn abs(&self) -> PointN<[f32; 2]>
[src]
pub fn at(&self, component_index: usize) -> <PointN<[f32; 2]> as Point>::Scalar
[src]
pub fn map_components(
&self,
f: impl Fn(<PointN<[f32; 2]> as Point>::Scalar) -> <PointN<[f32; 2]> as Point>::Scalar
) -> PointN<[f32; 2]>
[src]
&self,
f: impl Fn(<PointN<[f32; 2]> as Point>::Scalar) -> <PointN<[f32; 2]> as Point>::Scalar
) -> PointN<[f32; 2]>
impl Point for PointN<[f32; 3]>
[src]
type Scalar = f32
pub fn basis() -> Vec<PointN<[f32; 3]>>
[src]
pub fn abs(&self) -> PointN<[f32; 3]>
[src]
pub fn at(&self, component_index: usize) -> <PointN<[f32; 3]> as Point>::Scalar
[src]
pub fn map_components(
&self,
f: impl Fn(<PointN<[f32; 3]> as Point>::Scalar) -> <PointN<[f32; 3]> as Point>::Scalar
) -> PointN<[f32; 3]>
[src]
&self,
f: impl Fn(<PointN<[f32; 3]> as Point>::Scalar) -> <PointN<[f32; 3]> as Point>::Scalar
) -> PointN<[f32; 3]>
impl Point for PointN<[i32; 2]>
[src]
type Scalar = i32
pub fn basis() -> Vec<PointN<[i32; 2]>>
[src]
pub fn abs(&self) -> PointN<[i32; 2]>
[src]
pub fn at(&self, component_index: usize) -> <PointN<[i32; 2]> as Point>::Scalar
[src]
pub fn map_components(
&self,
f: impl Fn(<PointN<[i32; 2]> as Point>::Scalar) -> <PointN<[i32; 2]> as Point>::Scalar
) -> PointN<[i32; 2]>
[src]
&self,
f: impl Fn(<PointN<[i32; 2]> as Point>::Scalar) -> <PointN<[i32; 2]> as Point>::Scalar
) -> PointN<[i32; 2]>
impl Point for PointN<[i32; 3]>
[src]
type Scalar = i32
pub fn basis() -> Vec<PointN<[i32; 3]>>
[src]
pub fn abs(&self) -> PointN<[i32; 3]>
[src]
pub fn at(&self, component_index: usize) -> <PointN<[i32; 3]> as Point>::Scalar
[src]
pub fn map_components(
&self,
f: impl Fn(<PointN<[i32; 3]> as Point>::Scalar) -> <PointN<[i32; 3]> as Point>::Scalar
) -> PointN<[i32; 3]>
[src]
&self,
f: impl Fn(<PointN<[i32; 3]> as Point>::Scalar) -> <PointN<[i32; 3]> as Point>::Scalar
) -> PointN<[i32; 3]>