148 int* major,
int* minor)
const;
224 return xcoord * xcoord + ycoord * ycoord;
229 return std::sqrt(sqlength());
236 gap.xcoord = xcoord - pt.xcoord;
237 gap.ycoord = ycoord - pt.ycoord;
243 return std::sqrt(pt_to_pt_sqdist(pt));
248 return std::atan2(ycoord, xcoord);
252 uint8_t to_direction()
const;
254 void from_direction(uint8_t direction);
259 static uint8_t binary_angle_plus_pi(
double angle);
262 static double angle_from_direction(uint8_t direction);
268 const FCOORD& dir_vector)
const;
275 return xcoord == other.xcoord && ycoord == other.ycoord;
279 return xcoord != other.xcoord || ycoord != other.ycoord;
308 void rotate(
const FCOORD vec);
311 void unrotate(
const FCOORD &vec);
538 auto tmp =
static_cast<int16_t
>(std::floor(
xcoord * vec.
x() -
558 result.xcoord = -src.ycoord;
559 result.ycoord = src.xcoord;
576 result.xcoord = -src.xcoord;
577 result.ycoord = -src.ycoord;
594 sum.xcoord = op1.xcoord + op2.xcoord;
595 sum.ycoord = op1.ycoord + op2.ycoord;
610 op1.xcoord += op2.xcoord;
611 op1.ycoord += op2.ycoord;
628 sum.xcoord = op1.xcoord - op2.xcoord;
629 sum.ycoord = op1.ycoord - op2.ycoord;
644 op1.xcoord -= op2.xcoord;
645 op1.ycoord -= op2.ycoord;
660 return op1.xcoord * op2.xcoord + op1.ycoord * op2.ycoord;
673 return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
688 result.xcoord = op1.xcoord * scale;
689 result.ycoord = op1.ycoord * scale;
700 result.xcoord = op1.xcoord * scale;
701 result.ycoord = op1.ycoord * scale;
734 result.xcoord = op1.xcoord / scale;
735 result.ycoord = op1.ycoord / scale;
767 tmp = xcoord * vec.
x () - ycoord * vec.
y ();
768 ycoord = ycoord * vec.
x () + xcoord * vec.
y ();
int32_t operator*(const ICOORD &op1, const ICOORD &op2)
ICOORD & operator*=(ICOORD &op1, int16_t scale)
ICOORD & operator-=(ICOORD &op1, const ICOORD &op2)
ICOORD & operator/=(ICOORD &op1, int16_t scale)
ICOORD & operator+=(ICOORD &op1, const ICOORD &op2)
ICOORD operator/(const ICOORD &op1, int16_t scale)
int32_t operator%(const ICOORD &op1, const ICOORD &op2)
ICOORD operator-(const ICOORD &src)
ICOORD operator!(const ICOORD &src)
ICOORD operator+(const ICOORD &op1, const ICOORD &op2)
#define ELISTIZEH(CLASSNAME)
void set_x(int16_t xin)
rewrite function
friend int32_t operator*(const ICOORD &, const ICOORD &)
cross product
friend ICOORD & operator-=(ICOORD &, const ICOORD &)
subtract
void set_with_shrink(int x, int y)
Set from the given x,y, shrinking the vector to fit if needed.
int16_t y() const
access_function
friend int32_t operator%(const ICOORD &, const ICOORD &)
scalar product
ICOORD(int16_t xin, int16_t yin)
bool operator==(const ICOORD &other) const
test equality
void setup_render(ICOORD *major_step, ICOORD *minor_step, int *major, int *minor) const
bool Serialize(FILE *fp) const
friend ICOORD & operator+=(ICOORD &, const ICOORD &)
add
void set_y(int16_t yin)
rewrite function
float length() const
find length
float sqlength() const
find sq length
~ICOORD()=default
destructor
friend ICOORD operator!(const ICOORD &)
rotate 90 deg anti
float pt_to_pt_sqdist(const ICOORD &pt) const
sq dist between pts
float angle() const
find angle
float pt_to_pt_dist(const ICOORD &pt) const
Distance between pts.
friend ICOORD & operator*=(ICOORD &, int16_t)
multiply
int16_t x() const
access function
void rotate(const FCOORD &vec)
friend ICOORD operator-(const ICOORD &)
unary minus
friend ICOORD operator+(const ICOORD &, const ICOORD &)
add
bool operator!=(const ICOORD &other) const
test inequality
bool DeSerialize(bool swap, FILE *fp)
friend ICOORD & operator/=(ICOORD &, int16_t)
divide
ICOORD()
empty constructor
friend ICOORD operator/(const ICOORD &, int16_t)
divide
ICOORDELT()=default
empty constructor
static ICOORDELT * deep_copy(const ICOORDELT *src)
ICOORDELT(ICOORD icoord)
constructor from ICOORD
ICOORDELT(int16_t xin, int16_t yin)
FCOORD()=default
empty constructor
float length() const
find length
float pt_to_pt_sqdist(const FCOORD &pt) const
sq dist between pts
void rotate(const FCOORD vec)
void unrotate(const FCOORD &vec)
float angle() const
find angle
FCOORD(float xvalue, float yvalue)
float sqlength() const
find sq length
void set_y(float yin)
rewrite function
bool normalise()
Convert to unit vec.
void set_x(float xin)
rewrite function
float pt_to_pt_dist(const FCOORD &pt) const
Distance between pts.