223 return xcoord * xcoord + ycoord * ycoord;
228 return std::sqrt(sqlength());
235 gap.xcoord = xcoord - pt.xcoord;
236 gap.ycoord = ycoord - pt.ycoord;
242 return std::sqrt(pt_to_pt_sqdist(pt));
247 return std::atan2(ycoord, xcoord);
251 uint8_t to_direction()
const;
253 void from_direction(uint8_t direction);
258 static uint8_t binary_angle_plus_pi(
double angle);
261 static double angle_from_direction(uint8_t direction);
273 return xcoord == other.xcoord && ycoord == other.ycoord;
277 return xcoord != other.xcoord || ycoord != other.ycoord;
306 void rotate(
const FCOORD vec);
309 void unrotate(
const FCOORD &vec);
529 result.xcoord = -src.ycoord;
530 result.ycoord = src.xcoord;
545 result.xcoord = -src.xcoord;
546 result.ycoord = -src.ycoord;
561 sum.xcoord = op1.xcoord + op2.xcoord;
562 sum.ycoord = op1.ycoord + op2.ycoord;
575 op1.xcoord += op2.xcoord;
576 op1.ycoord += op2.ycoord;
591 sum.xcoord = op1.xcoord - op2.xcoord;
592 sum.ycoord = op1.ycoord - op2.ycoord;
605 op1.xcoord -= op2.xcoord;
606 op1.ycoord -= op2.ycoord;
619 return op1.xcoord * op2.xcoord + op1.ycoord * op2.ycoord;
631 return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
645 result.xcoord = op1.xcoord * scale;
646 result.ycoord = op1.ycoord * scale;
656 result.xcoord = op1.xcoord * scale;
657 result.ycoord = op1.ycoord * scale;
686 result.xcoord = op1.xcoord / scale;
687 result.ycoord = op1.ycoord / scale;
716 tmp = xcoord * vec.
x() - ycoord * vec.
y();
717 ycoord = ycoord * vec.
x() + xcoord * vec.
y();
#define ELISTIZEH(CLASSNAME)
ICOORD & operator+=(ICOORD &op1, const ICOORD &op2)
ICOORD & operator-=(ICOORD &op1, const ICOORD &op2)
ICOORD & operator*=(ICOORD &op1, TDimension scale)
int32_t operator%(const ICOORD &op1, const ICOORD &op2)
ICOORD operator+(const ICOORD &op1, const ICOORD &op2)
ICOORD operator!(const ICOORD &src)
int32_t operator*(const ICOORD &op1, const ICOORD &op2)
ICOORD & operator/=(ICOORD &op1, TDimension scale)
ICOORD operator/(const ICOORD &op1, TDimension scale)
ICOORD operator-(const ICOORD &src)
friend int32_t operator*(const ICOORD &, const ICOORD &)
cross product
float sqlength() const
find sq length
friend ICOORD operator/(const ICOORD &, TDimension)
divide
friend int32_t operator%(const ICOORD &, const ICOORD &)
scalar product
friend ICOORD & operator-=(ICOORD &, const ICOORD &)
subtract
void rotate(const FCOORD &vec)
float pt_to_pt_sqdist(const ICOORD &pt) const
sq dist between pts
void set_with_shrink(int x, int y)
Set from the given x,y, shrinking the vector to fit if needed.
void set_x(TDimension xin)
rewrite function
friend ICOORD operator!(const ICOORD &)
rotate 90 deg anti
TDimension y() const
access_function
bool DeSerialize(TFile *f)
friend ICOORD & operator+=(ICOORD &, const ICOORD &)
add
ICOORD()
empty constructor
float length() const
find length
void set_y(TDimension yin)
rewrite function
bool operator==(const ICOORD &other) const
test equality
TDimension x() const
access function
bool operator!=(const ICOORD &other) const
test inequality
float angle() const
find angle
friend ICOORD & operator/=(ICOORD &, TDimension)
divide
friend ICOORD operator-(const ICOORD &)
unary minus
ICOORD(TDimension xin, TDimension yin)
~ICOORD()=default
destructor
friend ICOORD operator+(const ICOORD &, const ICOORD &)
add
friend ICOORD & operator*=(ICOORD &, TDimension)
multiply
bool Serialize(TFile *f) const
float pt_to_pt_dist(const ICOORD &pt) const
Distance between pts.
void setup_render(ICOORD *major_step, ICOORD *minor_step, int *major, int *minor) const
ICOORDELT(ICOORD icoord)
constructor from ICOORD
ICOORDELT()=default
empty constructor
static ICOORDELT * deep_copy(const ICOORDELT *src)
ICOORDELT(TDimension xin, TDimension yin)
void set_y(float yin)
rewrite function
float length() const
find length
FCOORD(float xvalue, float yvalue)
float angle() const
find angle
float sqlength() const
find sq length
FCOORD()=default
empty constructor
float pt_to_pt_sqdist(const FCOORD &pt) const
sq dist between pts
float pt_to_pt_dist(const FCOORD &pt) const
Distance between pts.
void set_x(float xin)
rewrite function
void unrotate(const FCOORD &vec)
bool operator==(const FCOORD &other) const
test equality
void rotate(const FCOORD vec)
bool operator!=(const FCOORD &other) const
test inequality