149 int* major,
int* minor)
const;
225 return xcoord * xcoord + ycoord * ycoord;
230 return (
float) sqrt (sqlength ());
237 gap.xcoord = xcoord - pt.xcoord;
238 gap.ycoord = ycoord - pt.ycoord;
244 return (
float) sqrt (pt_to_pt_sqdist (pt));
249 return (
float) atan2 (ycoord, xcoord);
253 uint8_t to_direction()
const;
260 static uint8_t binary_angle_plus_pi(
double angle);
263 static double angle_from_direction(uint8_t
direction);
269 const FCOORD& dir_vector)
const;
276 return xcoord == other.xcoord && ycoord == other.ycoord;
280 return xcoord != other.xcoord || ycoord != other.ycoord;
309 void rotate(
const FCOORD vec);
312 void unrotate(
const FCOORD &vec);
541 tmp = (int16_t) floor (
xcoord * vec.
x () -
ycoord * vec.
y () + 0.5);
559 result.xcoord = -src.ycoord;
560 result.ycoord = src.xcoord;
577 result.xcoord = -src.xcoord;
578 result.ycoord = -src.ycoord;
595 sum.xcoord = op1.xcoord + op2.xcoord;
596 sum.ycoord = op1.ycoord + op2.ycoord;
611 op1.xcoord += op2.xcoord;
612 op1.ycoord += op2.ycoord;
629 sum.xcoord = op1.xcoord - op2.xcoord;
630 sum.ycoord = op1.ycoord - op2.ycoord;
645 op1.xcoord -= op2.xcoord;
646 op1.ycoord -= op2.ycoord;
661 return op1.xcoord * op2.xcoord + op1.ycoord * op2.ycoord;
674 return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
689 result.xcoord = op1.xcoord * scale;
690 result.ycoord = op1.ycoord * scale;
701 result.xcoord = op1.xcoord * scale;
702 result.ycoord = op1.ycoord * scale;
735 result.xcoord = op1.xcoord / scale;
736 result.ycoord = op1.ycoord / scale;
768 tmp = xcoord * vec.
x () - ycoord * vec.
y ();
769 ycoord = ycoord * vec.
x () + xcoord * vec.
y ();
ICOORD & operator+=(ICOORD &op1, const ICOORD &op2)
ICOORD & operator-=(ICOORD &op1, const ICOORD &op2)
bool Serialize(FILE *fp) const
void set_with_shrink(int x, int y)
Set from the given x,y, shrinking the vector to fit if needed.
FCOORD(float xvalue, float yvalue)
int32_t operator*(const ICOORD &op1, const ICOORD &op2)
#define ELISTIZEH(CLASSNAME)
ICOORD operator!(const ICOORD &src)
ICOORDELT(int16_t xin, int16_t yin)
bool operator==(const ICOORD &other) const
test equality
void set_x(int16_t xin)
rewrite function
ICOORD operator/(const ICOORD &op1, int16_t scale)
void rotate(const FCOORD vec)
int16_t y() const
access_function
int32_t operator%(const ICOORD &op1, const ICOORD &op2)
float pt_to_pt_sqdist(const FCOORD &pt) const
sq dist between pts
float angle() const
find angle
int direction(EDGEPT *point)
void set_x(float xin)
rewrite function
void setup_render(ICOORD *major_step, ICOORD *minor_step, int *major, int *minor) const
float pt_to_pt_sqdist(const ICOORD &pt) const
sq dist between pts
float pt_to_pt_dist(const FCOORD &pt) const
Distance between pts.
friend int32_t operator%(const ICOORD &, const ICOORD &)
scalar product
ICOORD operator-(const ICOORD &src)
friend ICOORD operator!(const ICOORD &)
rotate 90 deg anti
static ICOORDELT * deep_copy(const ICOORDELT *src)
bool operator!=(const ICOORD &other) const
test inequality
float pt_to_pt_dist(const ICOORD &pt) const
Distance between pts.
friend ICOORD & operator/=(ICOORD &, int16_t)
divide
int16_t x() const
access function
float sqlength() const
find sq length
float sqlength() const
find sq length
FCOORD()=default
empty constructor
friend ICOORD & operator+=(ICOORD &, const ICOORD &)
add
ICOORDELT(ICOORD icoord)
constructor from ICOORD
friend ICOORD operator+(const ICOORD &, const ICOORD &)
add
ICOORD operator+(const ICOORD &op1, const ICOORD &op2)
void rotate(const FCOORD &vec)
ICOORD & operator/=(ICOORD &op1, int16_t scale)
float length() const
find length
~ICOORD()=default
destructor
friend ICOORD & operator-=(ICOORD &, const ICOORD &)
subtract
ICOORD()
empty constructor
float angle() const
find angle
void unrotate(const FCOORD &vec)
float length() const
find length
ICOORD(int16_t xin, int16_t yin)
friend int32_t operator*(const ICOORD &, const ICOORD &)
cross product
friend ICOORD & operator*=(ICOORD &, int16_t)
multiply
void set_y(int16_t yin)
rewrite function
void set_y(float yin)
rewrite function
friend ICOORD operator-(const ICOORD &)
unary minus
ICOORD & operator*=(ICOORD &op1, int16_t scale)
friend ICOORD operator/(const ICOORD &, int16_t)
divide
bool DeSerialize(bool swap, FILE *fp)