|
The Game Engine
1
|
2D position or vector placed here because of general access More...
#include <fns.h>
Public Member Functions | |
| Point2D () | |
| Point2D (double X, double Y) | |
| Point2D (const Point2D ©) | |
| Point2D (const Size2D ©) | |
| Copy object. More... | |
| double | length () |
| The length of the Point (from origin) More... | |
| double | lengthSquared () const |
| The length of the Point (from origin) Ensure that all checks for value 0 use abs(lengthSquared()) < numeric_limits<double>::epsilon() (from limits) More... | |
| void | zero () |
| Sets the values of x,y to 0. More... | |
| Point2D | unitVec () |
| The unit vector of the Point (from origin) More... | |
| Point2D | normalize () |
| Normalizes the vector. More... | |
| Point2D | add (Point2D pt) |
| Adds the value of the point to this. More... | |
| Point2D | sub (Point2D pt) |
| Subtracts the value of the point from this. More... | |
| Point2D | mult (double d) |
| Multiplies the values of this by i. More... | |
| Point2D | div (double d) |
| Divides the values of this by i. More... | |
| Point2D | operator+ (const Point2D &pt) const |
| Point2D | operator- (const Point2D &pt) const |
| Point2D | operator* (const double scale) const |
| Point2D | operator/ (const double scale) const |
| Point2D | operator+= (const Point2D &pt) |
| Point2D | operator-= (const Point2D &pt) |
| Point2D | operator*= (const double scale) |
| Point2D | operator/= (const double scale) |
| bool | operator< (const Point2D &vec) |
| Compares the value of less as a comparison of the length squared (effectively magnitude squared) More... | |
| double | dot (Point2D p1, Point2D p2) |
| Returns the Dot product of two Point2D. More... | |
Public Attributes | |
| double | x |
| x position More... | |
| double | y |
| y Position More... | |
Friends | |
| ostream & | operator<< (ostream &out, Point2D p) |
2D position or vector placed here because of general access
This class is tasked with:
|
inline |
|
inline |
| Point2D Point2D::div | ( | double | d | ) |
| double Point2D::length | ( | ) |
| double Point2D::lengthSquared | ( | ) | const |
The length of the Point (from origin) Ensure that all checks for value 0 use abs(lengthSquared()) < numeric_limits<double>::epsilon() (from limits)
Definition at line 53 of file fns.cpp.
Here is the caller graph for this function:| Point2D Point2D::mult | ( | double | d | ) |
| Point2D Point2D::normalize | ( | ) |
|
inline |
| Point2D Point2D::unitVec | ( | ) |
| void Point2D::zero | ( | ) |