Public Member Functions | Private Attributes | List of all members
Point Class Reference

The Point class defines a position (or euclidean vector from (0,0)) in 2D space. More...

#include <Geom.h>

Inheritance diagram for Point:
Inheritance graph
[legend]

Public Member Functions

float Det (Point another) const
 Computes the determinant of matrix. More...
 
float EuclideanNorm () const
 Computes euclidean norm of vector. More...
 
std::pair< float, float > GetPair ()
 Creates STL pair (x,y) from point. More...
 
Point operator* (float k) const
 operator * More...
 
Point operator+ (const Point &another) const
 operator + More...
 
Point operator- (const Point &another) const
 operator - More...
 
Point operator- () const
 operator - More...
 
Point operator/ (float k) const
 operator / More...
 
virtual Pointoperator= (const Point &obj)
 Assignment operator. More...
 
bool operator== (const Point &another) const
 operator == More...
 
 Point ()
 Point default constructor. More...
 
 Point (float x, float y)
 Point constructor with parameters. More...
 
 Point (const Point &obj)
 Point copy constructor. More...
 
float ScalarProduct (const Point &another) const
 Computes scalar product of vectors (this * anoher) More...
 
float SquaredEuclideanNorm () const
 Computes squared euclidean norm of vector. More...
 
std::string ToString () const
 Creates STL string, which contains x,y values. More...
 
float X () const
 Returns X-coordinate of the point. More...
 
float Y () const
 Returns Y-coordinate of the point. More...
 
virtual ~Point ()=default
 Default destructor. More...
 

Private Attributes

float x
 X-coordinate of the point. More...
 
float y
 Y-coordinate of the point. More...
 

Detailed Description

The Point class defines a position (or euclidean vector from (0,0)) in 2D space.

Definition at line 61 of file Geom.h.

Constructor & Destructor Documentation

Point::Point ( )

Point default constructor.

Definition at line 10 of file Geom.cpp.

Point::Point ( float  x,
float  y 
)

Point constructor with parameters.

Parameters
xX-coordinate of the point.
yY-coordinate of the point.

Definition at line 17 of file Geom.cpp.

Point::Point ( const Point obj)

Point copy constructor.

Parameters
objAn object to copy.

Definition at line 36 of file Geom.cpp.

virtual Point::~Point ( )
virtualdefault

Default destructor.

Member Function Documentation

float Point::Det ( Point  another) const
inline

Computes the determinant of matrix.

Map sheme
Parameters
anotherSecond column of matrix
Returns
The determinant of matrix.

Definition at line 492 of file Geom.h.

float Point::EuclideanNorm ( ) const
inline

Computes euclidean norm of vector.

Returns
Euclidean norm of vector.

Definition at line 486 of file Geom.h.

std::pair< float, float > Point::GetPair ( )

Creates STL pair (x,y) from point.

Returns
STL pair (x,y).

Definition at line 43 of file Geom.cpp.

Point Point::operator* ( float  k) const
inline

operator *

Parameters
kScalar multiplier.
Returns
(k * x, k * y)

Definition at line 467 of file Geom.h.

Point Point::operator+ ( const Point another) const
inline

operator +

Parameters
anotherSecond operand
Returns
(this.x + another.x, this.y + another.y)

Definition at line 461 of file Geom.h.

Point Point::operator- ( const Point another) const
inline

operator -

Parameters
anotherSecond operand
Returns
(this.x - another.x, this.y - another.y)

Definition at line 455 of file Geom.h.

Point Point::operator- ( ) const
inline

operator -

Returns
(-x, -y)

Definition at line 504 of file Geom.h.

Point Point::operator/ ( float  k) const
inline

operator /

Parameters
kScalar divider.
Returns
( x / k, y / k)

Definition at line 473 of file Geom.h.

Point & Point::operator= ( const Point obj)
inlinevirtual

Assignment operator.

Parameters
objObject to assign
Returns
Reference to object.

Definition at line 510 of file Geom.h.

bool Point::operator== ( const Point another) const
inline

operator ==

Parameters
anotherObject to compare.
Returns
(x, y) == (another.x, another.y)

Definition at line 498 of file Geom.h.

float Point::ScalarProduct ( const Point another) const
inline

Computes scalar product of vectors (this * anoher)

Parameters
anotherSecond operand of scalar product
Returns
Result of scalar product of vectors (this * anoher)

Definition at line 449 of file Geom.h.

float Point::SquaredEuclideanNorm ( ) const
inline

Computes squared euclidean norm of vector.

Returns
Squared euclidean norm of vector.

Definition at line 480 of file Geom.h.

std::string Point::ToString ( ) const

Creates STL string, which contains x,y values.

Returns
STL string, which contains x,y values.

Definition at line 48 of file Geom.cpp.

float Point::X ( ) const

Returns X-coordinate of the point.

Returns
X-coordinate of the point.

Definition at line 24 of file Geom.cpp.

float Point::Y ( ) const

Returns Y-coordinate of the point.

Returns
Y-coordinate of the point.

Definition at line 30 of file Geom.cpp.

Member Data Documentation

float Point::x
private

X-coordinate of the point.

Definition at line 192 of file Geom.h.

float Point::y
private

Y-coordinate of the point.

Definition at line 193 of file Geom.h.


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


ORCAStar
Author(s): Stepan Drgachev
autogenerated on Wed Jul 15 2020 16:13:14