Struct dumbmath::vec2f::Vec2f [] [src]

pub struct Vec2f {
    pub x: f32,
    pub y: f32,
}

Vector with two f32 components

Fields

x
y

Methods

impl Vec2f

fn new(x: f32, y: f32) -> Vec2f

Create a Vec2f from two components

fn cross(self, other: Vec2f) -> f32

fn lerp(self, other: Vec2f, t: f32) -> Vec2f

fn dot(self, other: Vec2f) -> f32

fn vec3f(self) -> Vec3f

fn distance_squared(self, other: Vec2f) -> f32

fn distance(self, other: Vec2f) -> f32

fn magnitude_squared(self) -> f32

fn magnitude(self) -> f32

fn normalized(self) -> Option<Vec2f>

Trait Implementations

impl Add for Vec2f

type Output = Vec2f

fn add(self, v: Vec2f) -> Vec2f

impl Sub for Vec2f

type Output = Vec2f

fn sub(self, v: Vec2f) -> Vec2f

impl Mul<f32> for Vec2f

type Output = Vec2f

fn mul(self, s: f32) -> Vec2f

impl Div<f32> for Vec2f

type Output = Vec2f

fn div(self, s: f32) -> Vec2f

Derived Implementations

impl PartialEq for Vec2f

fn eq(&self, __arg_0: &Vec2f) -> bool

fn ne(&self, __arg_0: &Vec2f) -> bool

impl Debug for Vec2f

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Copy for Vec2f

impl Clone for Vec2f

fn clone(&self) -> Vec2f

fn clone_from(&mut self, source: &Self)