ELEC2645 (2018/19) / Mbed 2 deprecated el17dg

Dependencies:   mbed

Fork of el17dg by Dmitrijs Griskovs

Embed: (wiki syntax)

« Back to documentation index

Point Struct Reference

Point Struct Reference

Position or vector on the screen. More...

#include <collision_lib.h>

int x
 the x position
int y
 the y position
 Point ()
 Default constructor.
 Point (int _x, int _y)
 Constructor with x and y parameters.
Point operator+ (const Point &rhs) const
 Vector addition.
Point operator- (const Point &rhs) const
 Vector substraction.
int lengthSquared ()
 Length of vector squared.

Detailed Description

Position or vector on the screen.

Supports basic vector arithmetics.

Definition at line 10 of file collision_lib.h.


Constructor & Destructor Documentation

Point (  )

Default constructor.

Definition at line 15 of file collision_lib.h.

Point ( int  _x,
int  _y 
)

Constructor with x and y parameters.

Definition at line 17 of file collision_lib.h.


Member Function Documentation

int lengthSquared (  )

Length of vector squared.

Definition at line 38 of file collision_lib.h.

Point operator+ ( const Point rhs ) const

Vector addition.

Definition at line 22 of file collision_lib.h.

Point operator- ( const Point rhs ) const

Vector substraction.

Definition at line 30 of file collision_lib.h.


Field Documentation

int x

the x position

Definition at line 12 of file collision_lib.h.

int y

the y position

Definition at line 13 of file collision_lib.h.