FOUND
Loading...
Searching...
No Matches
found::Vec2 Struct Reference

A Vec2 is an immutable object that represents a 2D Vector. More...

#include <attitude-utils.hpp>

Public Member Functions

decimal Magnitude () const
 Provides the magnitude of this Vec2.
 
decimal MagnitudeSq () const
 Provides the square of the magnitude of this Vec2.
 
Vec2 Normalize () const
 Normalizes this.
 
decimal operator* (const Vec2 &other) const
 Dot product (Scalar product)
 
Vec2 operator* (const decimal &scalar) const
 Scalar-vector Product.
 
Vec2 operator+ (const Vec2 &other) const
 Vector Addition.
 
Vec2 operator- (const Vec2 &other) const
 Vector Subtraction.
 

Public Attributes

decimal x
 The x coordinate.
 
decimal y
 The y coordinate.
 

Detailed Description

A Vec2 is an immutable object that represents a 2D Vector.

Member Function Documentation

◆ Magnitude()

decimal found::Vec2::Magnitude ( ) const

Provides the magnitude of this Vec2.

Returns
The magnitude of this

◆ MagnitudeSq()

decimal found::Vec2::MagnitudeSq ( ) const

Provides the square of the magnitude of this Vec2.

Returns
The square of the magnitude of this

◆ Normalize()

Vec2 found::Vec2::Normalize ( ) const

Normalizes this.

Returns
The normalized vector of this

◆ operator*() [1/2]

Vec2 found::Vec2::operator* ( const decimal &  scalar) const

Scalar-vector Product.

Parameters
scalarThe scalar
Returns
scalar * this

◆ operator*() [2/2]

decimal found::Vec2::operator* ( const Vec2 other) const

Dot product (Scalar product)

Parameters
otherThe other vector
Returns
The dot of this and other

◆ operator+()

Vec2 found::Vec2::operator+ ( const Vec2 other) const

Vector Addition.

Parameters
otherThe other vector
Returns
this + other

◆ operator-()

Vec2 found::Vec2::operator- ( const Vec2 other) const

Vector Subtraction.

Parameters
otherThe other vector
Returns
this - other

The documentation for this struct was generated from the following files: