#include <points.h>
|
FCOORD | operator! (const FCOORD &) |
| rotate 90 deg anti More...
|
|
FCOORD | operator- (const FCOORD &) |
| unary minus More...
|
|
FCOORD | operator+ (const FCOORD &, const FCOORD &) |
| add More...
|
|
FCOORD & | operator+= (FCOORD &, const FCOORD &) |
| add More...
|
|
FCOORD | operator- (const FCOORD &, const FCOORD &) |
| subtract More...
|
|
FCOORD & | operator-= (FCOORD &, const FCOORD &) |
| subtract More...
|
|
float | operator% (const FCOORD &, const FCOORD &) |
| scalar product More...
|
|
float | operator* (const FCOORD &, const FCOORD &) |
| cross product More...
|
|
FCOORD | operator* (const FCOORD &, float) |
| multiply More...
|
|
FCOORD | operator* (float, const FCOORD &) |
| multiply More...
|
|
FCOORD & | operator*= (FCOORD &, float) |
| multiply More...
|
|
FCOORD | operator/ (const FCOORD &, float) |
| divide More...
|
|
FCOORD & | operator/= (FCOORD &, float) |
| divide More...
|
|
Definition at line 188 of file points.h.
◆ FCOORD() [1/3]
◆ FCOORD() [2/3]
FCOORD::FCOORD |
( |
float |
xvalue, |
|
|
float |
yvalue |
|
) |
| |
|
inline |
constructor
- Parameters
-
xvalue | x value |
yvalue | y value |
Definition at line 196 of file points.h.
◆ FCOORD() [3/3]
FCOORD::FCOORD |
( |
ICOORD |
icoord | ) |
|
|
inline |
◆ angle()
float FCOORD::angle |
( |
| ) |
const |
|
inline |
find angle
Definition at line 247 of file points.h.
248 return std::atan2(ycoord, xcoord);
◆ angle_from_direction()
double FCOORD::angle_from_direction |
( |
uint8_t |
direction | ) |
|
|
static |
Definition at line 126 of file points.cpp.
127 return direction * M_PI / 128.0 - M_PI;
◆ binary_angle_plus_pi()
uint8_t FCOORD::binary_angle_plus_pi |
( |
double |
angle | ) |
|
|
static |
Definition at line 121 of file points.cpp.
int IntCastRounded(double x)
◆ from_direction()
void FCOORD::from_direction |
( |
uint8_t |
direction | ) |
|
Definition at line 112 of file points.cpp.
114 xcoord = cos(radians);
115 ycoord = sin(radians);
static double angle_from_direction(uint8_t direction)
◆ length()
float FCOORD::length |
( |
| ) |
const |
|
inline |
find length
Definition at line 228 of file points.h.
float sqlength() const
find sq length
◆ nearest_pt_on_line()
FCOORD FCOORD::nearest_pt_on_line |
( |
const FCOORD & |
line_point, |
|
|
const FCOORD & |
dir_vector |
|
) |
| const |
Definition at line 133 of file points.cpp.
135 FCOORD point_vector(*
this - line_point);
140 double lambda = point_vector % dir_vector / dir_vector.
sqlength();
141 return line_point + (dir_vector * lambda);
float sqlength() const
find sq length
◆ normalise()
bool FCOORD::normalise |
( |
| ) |
|
◆ operator!=()
test inequality
Definition at line 278 of file points.h.
279 return xcoord != other.xcoord || ycoord != other.ycoord;
◆ operator==()
bool FCOORD::operator== |
( |
const FCOORD & |
other | ) |
|
|
inline |
test equality
Definition at line 274 of file points.h.
275 return xcoord == other.xcoord && ycoord == other.ycoord;
◆ pt_to_pt_dist()
float FCOORD::pt_to_pt_dist |
( |
const FCOORD & |
pt | ) |
const |
|
inline |
Distance between pts.
Definition at line 242 of file points.h.
float pt_to_pt_sqdist(const FCOORD &pt) const
sq dist between pts
◆ pt_to_pt_sqdist()
float FCOORD::pt_to_pt_sqdist |
( |
const FCOORD & |
pt | ) |
const |
|
inline |
sq dist between pts
Definition at line 233 of file points.h.
236 gap.xcoord = xcoord - pt.xcoord;
237 gap.ycoord = ycoord - pt.ycoord;
float sqlength() const
find sq length
◆ rotate()
void FCOORD::rotate |
( |
const FCOORD |
vec | ) |
|
|
inline |
rotate
- Parameters
-
Definition at line 763 of file points.h.
767 tmp = xcoord * vec.
x () - ycoord * vec.
y ();
768 ycoord = ycoord * vec.
x () + xcoord * vec.
y ();
◆ set_x()
void FCOORD::set_x |
( |
float |
xin | ) |
|
|
inline |
rewrite function
Definition at line 214 of file points.h.
◆ set_y()
void FCOORD::set_y |
( |
float |
yin | ) |
|
|
inline |
rewrite function
Definition at line 218 of file points.h.
◆ sqlength()
float FCOORD::sqlength |
( |
| ) |
const |
|
inline |
find sq length
Definition at line 223 of file points.h.
224 return xcoord * xcoord + ycoord * ycoord;
◆ to_direction()
uint8_t FCOORD::to_direction |
( |
| ) |
const |
Definition at line 108 of file points.cpp.
static uint8_t binary_angle_plus_pi(double angle)
float angle() const
find angle
◆ unrotate()
void FCOORD::unrotate |
( |
const FCOORD & |
vec | ) |
|
|
inline |
Definition at line 772 of file points.h.
void rotate(const FCOORD vec)
FCOORD()=default
empty constructor
◆ x()
float FCOORD::x |
( |
| ) |
const |
|
inline |
◆ y()
float FCOORD::y |
( |
| ) |
const |
|
inline |
◆ operator!
rotate 90 deg anti
Definition at line 553 of file points.h.
558 result.xcoord = -src.ycoord;
559 result.ycoord = src.xcoord;
◆ operator%
scalar product
Definition at line 657 of file points.h.
660 return op1.xcoord * op2.xcoord + op1.ycoord * op2.ycoord;
◆ operator* [1/3]
cross product
Definition at line 670 of file points.h.
673 return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
◆ operator* [2/3]
multiply
Definition at line 683 of file points.h.
688 result.xcoord = op1.xcoord * scale;
689 result.ycoord = op1.ycoord * scale;
◆ operator* [3/3]
multiply
Definition at line 694 of file points.h.
700 result.xcoord = op1.xcoord * scale;
701 result.ycoord = op1.ycoord * scale;
◆ operator*=
◆ operator+
add
Definition at line 589 of file points.h.
594 sum.xcoord = op1.xcoord + op2.xcoord;
595 sum.ycoord = op1.ycoord + op2.ycoord;
◆ operator+=
add
Definition at line 607 of file points.h.
610 op1.xcoord += op2.xcoord;
611 op1.ycoord += op2.ycoord;
◆ operator- [1/2]
unary minus
Definition at line 571 of file points.h.
576 result.xcoord = -src.xcoord;
577 result.ycoord = -src.ycoord;
◆ operator- [2/2]
subtract
Definition at line 623 of file points.h.
628 sum.xcoord = op1.xcoord - op2.xcoord;
629 sum.ycoord = op1.ycoord - op2.ycoord;
◆ operator-=
subtract
Definition at line 641 of file points.h.
644 op1.xcoord -= op2.xcoord;
645 op1.ycoord -= op2.ycoord;
◆ operator/
divide
Definition at line 729 of file points.h.
734 result.xcoord = op1.xcoord / scale;
735 result.ycoord = op1.ycoord / scale;
◆ operator/=
The documentation for this class was generated from the following files: