Euphoria
eu::n2 Struct Reference

a 2d unit (vector) More...

Public Member Functions

 n2 (float ax, float ay)
 asserts that the length is 1
 n2 (const v2 &v)
 asserts that the length is 1
n2 get_rotated (const An &a) const
 Assumes the unit vector is a point and returns it if it was rotated around (0,0).
const float * get_data_ptr () const
 Returns an array to the data.
n2 get_flipped_y () const
 Returns a new unit vector where the sign of the y component is flipped.
bool is_valid () const
 returns false if the length isn't 1
n2 operator- () const

Public Attributes

float x
float y

Detailed Description

a 2d unit (vector)

Definition at line 74 of file vec2.h.

Constructor & Destructor Documentation

◆ n2() [1/2]

eu::n2::n2 ( float ax,
float ay )
explicit

asserts that the length is 1

◆ n2() [2/2]

eu::n2::n2 ( const v2 & v)
explicit

asserts that the length is 1

Member Function Documentation

◆ get_data_ptr()

const float * eu::n2::get_data_ptr ( ) const
nodiscard

Returns an array to the data.

◆ get_flipped_y()

n2 eu::n2::get_flipped_y ( ) const
nodiscard

Returns a new unit vector where the sign of the y component is flipped.

◆ get_rotated()

n2 eu::n2::get_rotated ( const An & a) const
nodiscard

Assumes the unit vector is a point and returns it if it was rotated around (0,0).

◆ is_valid()

bool eu::n2::is_valid ( ) const
nodiscard

returns false if the length isn't 1

◆ operator-()

n2 eu::n2::operator- ( ) const

Member Data Documentation

◆ x

float eu::n2::x

Definition at line 76 of file vec2.h.

◆ y

float eu::n2::y

Definition at line 77 of file vec2.h.


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