#include <grid.hh>
Public Member Functions | |
| Point () | |
| Create a point. | |
| Point (float x, float y) | |
Create a point (x, y). | |
| Point & | rot90 () |
| Rotate the point 90 degrees. | |
| Point | get_rot90 () const |
| Return the point rotated 90 degrees. | |
| float | dot (const Point &p) const |
| Compute dot product. | |
| Point & | add (const Point &p, float scale=1) |
| Add another point to the point. | |
| Point | get_add (const Point &p, float scale=1) const |
| Return the result of adding another point from the point. | |
| Point & | sub (const Point &p, float scale=1) |
| Substract another point from the point. | |
| Point | get_sub (const Point &p, float scale=1) const |
| Return the result of subtracting another point from the point. | |
| Point & | scale (float scale) |
| Scale the point. | |
| float | angle () const |
| Compute the angle of the vector in radians. | |
| float | length () const |
| Compute the length of the vector. | |
| Point & | normalize (float length) |
| Normalize the length of the vector. | |
Public Attributes | |
| float | x |
| Coordinate of the point. | |
| float | y |
| Coordinate of the point. | |
|
||||||||||||
|
Create a point (
|
|
||||||||||||
|
Add another point to the point.
|
|
|
Compute the angle of the vector in radians.
|
|
|
Compute dot product.
|
|
||||||||||||
|
Return the result of adding another point from the point.
|
|
|
Return the point rotated 90 degrees.
|
|
||||||||||||
|
Return the result of subtracting another point from the point.
|
|
|
Compute the length of the vector.
|
|
|
Normalize the length of the vector.
|
|
|
Scale the point.
|
|
||||||||||||
|
Substract another point from the point.
|
1.3.4