#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 189 of file points.h.
◆ FCOORD() [1/3]
tesseract::FCOORD::FCOORD |
( |
| ) |
|
|
default |
◆ FCOORD() [2/3]
tesseract::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]
tesseract::FCOORD::FCOORD |
( |
ICOORD |
icoord | ) |
|
|
inline |
Definition at line 200 of file points.h.
202 xcoord = icoord.xcoord;
203 ycoord = icoord.ycoord;
◆ angle()
float tesseract::FCOORD::angle |
( |
| ) |
const |
|
inline |
find angle
Definition at line 246 of file points.h.
247 return std::atan2(ycoord, xcoord);
◆ angle_from_direction()
double tesseract::FCOORD::angle_from_direction |
( |
uint8_t |
direction | ) |
|
|
static |
Definition at line 141 of file points.cpp.
142 return direction * M_PI / 128.0 - M_PI;
◆ binary_angle_plus_pi()
uint8_t tesseract::FCOORD::binary_angle_plus_pi |
( |
double |
angle | ) |
|
|
static |
Definition at line 136 of file points.cpp.
int IntCastRounded(double x)
◆ from_direction()
void tesseract::FCOORD::from_direction |
( |
uint8_t |
direction | ) |
|
Definition at line 127 of file points.cpp.
129 xcoord = cos(radians);
130 ycoord = sin(radians);
static double angle_from_direction(uint8_t direction)
◆ length()
float tesseract::FCOORD::length |
( |
| ) |
const |
|
inline |
find length
Definition at line 227 of file points.h.
float sqlength() const
find sq length
◆ nearest_pt_on_line()
FCOORD tesseract::FCOORD::nearest_pt_on_line |
( |
const FCOORD & |
line_point, |
|
|
const FCOORD & |
dir_vector |
|
) |
| const |
Definition at line 148 of file points.cpp.
149 FCOORD point_vector(*
this - line_point);
154 double lambda = point_vector % dir_vector / dir_vector.sqlength();
155 return line_point + (dir_vector * lambda);
FCOORD()=default
empty constructor
◆ normalise()
bool tesseract::FCOORD::normalise |
( |
| ) |
|
Convert to unit vec.
Definition at line 32 of file points.cpp.
35 if (len < 0.0000000001) {
float length() const
find length
◆ operator!=()
test inequality
Definition at line 276 of file points.h.
277 return xcoord != other.xcoord || ycoord != other.ycoord;
◆ operator==()
bool tesseract::FCOORD::operator== |
( |
const FCOORD & |
other | ) |
|
|
inline |
test equality
Definition at line 272 of file points.h.
273 return xcoord == other.xcoord && ycoord == other.ycoord;
◆ pt_to_pt_dist()
float tesseract::FCOORD::pt_to_pt_dist |
( |
const FCOORD & |
pt | ) |
const |
|
inline |
Distance between pts.
Definition at line 241 of file points.h.
float pt_to_pt_sqdist(const FCOORD &pt) const
sq dist between pts
◆ pt_to_pt_sqdist()
float tesseract::FCOORD::pt_to_pt_sqdist |
( |
const FCOORD & |
pt | ) |
const |
|
inline |
sq dist between pts
Definition at line 232 of file points.h.
235 gap.xcoord = xcoord - pt.xcoord;
236 gap.ycoord = ycoord - pt.ycoord;
237 return gap.sqlength();
◆ rotate()
void tesseract::FCOORD::rotate |
( |
const FCOORD |
vec | ) |
|
|
inline |
rotate
- Parameters
-
Definition at line 712 of file points.h.
716 tmp = xcoord * vec.x() - ycoord * vec.y();
717 ycoord = ycoord * vec.x() + xcoord * vec.y();
◆ set_x()
void tesseract::FCOORD::set_x |
( |
float |
xin | ) |
|
|
inline |
rewrite function
Definition at line 213 of file points.h.
◆ set_y()
void tesseract::FCOORD::set_y |
( |
float |
yin | ) |
|
|
inline |
rewrite function
Definition at line 217 of file points.h.
◆ sqlength()
float tesseract::FCOORD::sqlength |
( |
| ) |
const |
|
inline |
find sq length
Definition at line 222 of file points.h.
223 return xcoord * xcoord + ycoord * ycoord;
◆ to_direction()
uint8_t tesseract::FCOORD::to_direction |
( |
| ) |
const |
Definition at line 123 of file points.cpp.
float angle() const
find angle
static uint8_t binary_angle_plus_pi(double angle)
◆ unrotate()
void tesseract::FCOORD::unrotate |
( |
const FCOORD & |
vec | ) |
|
|
inline |
Definition at line 721 of file points.h.
void rotate(const FCOORD vec)
◆ x()
float tesseract::FCOORD::x |
( |
| ) |
const |
|
inline |
◆ y()
float tesseract::FCOORD::y |
( |
| ) |
const |
|
inline |
◆ operator!
rotate 90 deg anti
Definition at line 524 of file points.h.
529 result.xcoord = -src.ycoord;
530 result.ycoord = src.xcoord;
◆ operator%
scalar product
Definition at line 616 of file points.h.
619 return op1.xcoord * op2.xcoord + op1.ycoord * op2.ycoord;
◆ operator* [1/3]
cross product
Definition at line 628 of file points.h.
631 return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
◆ operator* [2/3]
multiply
Definition at line 640 of file points.h.
645 result.xcoord = op1.xcoord * scale;
646 result.ycoord = op1.ycoord * scale;
◆ operator* [3/3]
multiply
Definition at line 650 of file points.h.
656 result.xcoord = op1.xcoord * scale;
657 result.ycoord = op1.ycoord * scale;
◆ operator*=
◆ operator+
add
Definition at line 556 of file points.h.
561 sum.xcoord = op1.xcoord + op2.xcoord;
562 sum.ycoord = op1.ycoord + op2.ycoord;
◆ operator+=
add
Definition at line 572 of file points.h.
575 op1.xcoord += op2.xcoord;
576 op1.ycoord += op2.ycoord;
◆ operator- [1/2]
unary minus
Definition at line 540 of file points.h.
545 result.xcoord = -src.xcoord;
546 result.ycoord = -src.ycoord;
◆ operator- [2/2]
subtract
Definition at line 586 of file points.h.
591 sum.xcoord = op1.xcoord - op2.xcoord;
592 sum.ycoord = op1.ycoord - op2.ycoord;
◆ operator-=
subtract
Definition at line 602 of file points.h.
605 op1.xcoord -= op2.xcoord;
606 op1.ycoord -= op2.ycoord;
◆ operator/
divide
Definition at line 681 of file points.h.
686 result.xcoord = op1.xcoord / scale;
687 result.ycoord = op1.ycoord / scale;
◆ operator/=
The documentation for this class was generated from the following files: