[][src]Trait gridly::vector::VectorLike

pub trait VectorLike: Sized {
    fn rows(&self) -> Rows;
fn columns(&self) -> Columns;
fn as_vector(&self) -> Vector; fn manhattan_length(&self) -> isize { ... }
fn checked_manhattan_length(&self) -> Option<isize> { ... }
fn clockwise(&self) -> Vector { ... }
fn anticlockwise(&self) -> Vector { ... }
fn reverse(&self) -> Vector { ... }
fn get_component<T: Component>(&self) -> T { ... }
fn transpose(&self) -> Vector { ... }
fn direction(&self) -> Option<Direction> { ... } }

Required methods

fn rows(&self) -> Rows

fn columns(&self) -> Columns

fn as_vector(&self) -> Vector

Loading content...

Provided methods

fn manhattan_length(&self) -> isize

Return the Manhattan length of the vector

The Manhattan length of a vector is the sum of the absolute values of its components.

fn checked_manhattan_length(&self) -> Option<isize>

fn clockwise(&self) -> Vector

Return a new vector, rotated 90 degrees clockwise.

fn anticlockwise(&self) -> Vector

Return a new vector, rotated 90 degrees counterclockwise.

fn reverse(&self) -> Vector

fn get_component<T: Component>(&self) -> T

Generically get either the Rows or Columns of a vector

fn transpose(&self) -> Vector

Swap the rows and columns of this Vector

fn direction(&self) -> Option<Direction>

If the vector is pointing in an orthogonal direction, return that direction

Loading content...

Implementations on Foreign Types

impl VectorLike for (Rows, Columns)[src]

impl VectorLike for (Columns, Rows)[src]

impl VectorLike for (isize, isize)[src]

impl<'_, T: VectorLike> VectorLike for &'_ T[src]

Loading content...

Implementors

impl VectorLike for Direction[src]

A Direction acts like a unit vector in the given direction

impl VectorLike for Columns[src]

impl VectorLike for Rows[src]

impl VectorLike for Vector[src]

Loading content...