Crate coord[][src]

coord is a simple, ergonomic vector mathematics crate designed for use in game development, physics engines and other programs that deal with general-purpose multi-variable mathematics

Features

  • Support for basic vector operations
  • Support for basic primitive operations
  • Basic mathematical operations upon vectors
  • Vector serialization

Examples

#[macro_use] extern crate coord;
use coord::prelude::*;

fn main() {
    // Coord supports 4 multi-variable vector types: Vec1, Vec2, Vec3 and Vec4
    let mut v0 = vec3!(1, 2, 3);
    v0 += vec3![1; 3] * 5;
    let _ = v0 * vec3!([10, 10, 10]);

    // Coord allows arbitrary vector component types
    let _ = vec2!(true, false); // Create a boolean vector
}

Re-exports

pub use vec1::Vec1;
pub use vec2::Vec2;
pub use vec3::Vec3;
pub use vec4::Vec4;
pub use math::VecNum;
pub use math::VecInt;
pub use math::VecUnsigned;
pub use math::VecSigned;
pub use math::VecFloat;

Modules

defaults

This module contains several type definitions that make working with coord simpler and faster

macros
math
prelude

This module contains a variety of commonly used types and functions.

vec1
vec2
vec3
vec4

Macros

vec1

Examples

vec2

Examples

vec3

Examples

vec4

Examples

Traits

VecItem
Vector