1 #ifndef UGDK_MATH_INTEGER2D_H_
2 #define UGDK_MATH_INTEGER2D_H_
8 #pragma SWIG nowarn=312
48 struct {
int val[2]; };
117 return center + (*
this - center).
Rotated(rotdeg);
250 return this->
x == right.
x && this->
y == right.
y;
261 Integer2D
operator*(
int scalar,
const Integer2D &right);
267 Vector2D
operator*(
double scalar,
const Integer2D &right);
272 #endif // UGDK_MATH_INTEGER2D_H_
Integer2D operator*(int scalar, const Integer2D &right)
Method that returns a integer equal to the a integer multiplied by a scalar.
Integer2D & operator+=(const Integer2D &other)
Integer2D operator%(int scalar) const
Remainder of integer division by "scalar" in each coordinate.
Definition: vector2D.h:18
Integer2D Mirrored(const ugdk::enums::mirroraxis::MirrorAxis mirror) const
Returns a new Integer2D, mirrored by the "axis" axis. Include types.h and use "using namespace ugdk::...
Integer2D Rotated(RotDeg rotdeg) const
Returns a new integer equal to this integer rotated by "angle" (in radians) counter-clockwise.
Integer2D operator-() const
Method that returns a integer equal to the oposite of another.
double LengthSquared() const
Returns the norm-2 squared.
Definition: integer2D.h:78
Definition: integer2D.h:20
Integer2D & operator/=(int scalar)
Integer2D & operator%=(int scalar)
~Integer2D()
Definition: integer2D.h:43
void Rotate(RotDeg rotdeg, const Integer2D ¢er)
Returns a new integer equal to this integer rotated by "angle" (in radians) counter-clockwise.
Definition: integer2D.h:98
Definition: animation.h:11
Integer2D & operator*=(int scalar)
Integer2D Remainder(const Integer2D &divisor) const
Returns a new Integer2D that is equal to the remainder of the integer division by "divisor"...
int get_y() const
Definition: integer2D.h:52
Integer2D Rotated(RotDeg rotdeg, const Integer2D ¢er) const
Returns a new integer equal to this integer rotated by "angle" (in radians) counter-clockwise.
Definition: integer2D.h:116
void Mod(const Integer2D &divisor)
In-place remainder (coordinate by coordinate) of integer division by "divisor".
void set_y(int y_)
Definition: integer2D.h:54
bool operator!=(const Integer2D &right) const
True when operator== is false.
Definition: integer2D.h:254
Integer2D(int _x, int _y)
Initializes both fields with given values.
Definition: integer2D.h:38
double Length() const
Returns the norm-2 of this integer.
Definition: integer2D.h:16
RotDeg
Definition: integer2D.h:15
Integer2D Scaled(const Integer2D &multiplier, const Integer2D &divisor) const
Returns a new Integer2D, multiplied by "multiplier", and divided by "divisor".
int get_x() const
Definition: integer2D.h:51
int y
Definition: integer2D.h:47
Integer2D operator+(const Integer2D &right) const
Method that returns a integer equal to the sum of two others.
Integer2D()
Initializes both fields with 0.
Definition: integer2D.h:25
Definition: integer2D.h:16
Definition: integer2D.h:16
void Mirror(const ugdk::enums::mirroraxis::MirrorAxis mirror)
Mirrors this Integer2D (in-place) by the "axis" axis. Include types.h and use "using namespace ugdk::...
void set_x(int x_)
Definition: integer2D.h:53
int val[2]
Definition: integer2D.h:48
double Angle() const
Returns the angle (in radians) of this integer.
Integer2D & operator-=(const Integer2D &other)
void Multiply(const Integer2D &multiplier)
In-place integer multiplication, coordinate by coordinate.
void Rotate(RotDeg rotdeg)
Returns a new integer equal to this integer rotated by "angle" (in radians) counter-clockwise.
Integer2D operator/(int scalar) const
Method that returns a integer equal to the a integer multiplied by the inverse of a scalar...
Integer2D operator*(int scalar) const
Method that returns a integer equal to the a integer multiplied by a int.
int NormOne() const
Returns the norm-1 of this integer.
void Scale(const Integer2D &multiplier, const Integer2D &divisor)
Multiplies in-place by "multiplier", and then divides by "divisor".
Integer2D(int val)
Initializes both fields with val.
Definition: integer2D.h:31
bool operator==(const Integer2D &right) const
Checks if their coordinates are equal, coordinate by coordinate.
Definition: integer2D.h:249
Integer2D Divided(const Integer2D ÷r) const
Returns a new Integer2D equal to this divided coordinate by coordinate by "multiplier".
Integer2D Multiplied(const Integer2D &multiplier) const
Returns a new Integer2D equal to this multiplied coordinate by coordinate by "multiplier".
MirrorAxis
Definition: types.h:29
int x
Definition: integer2D.h:47
void Divide(const Integer2D ÷r)
In-place integer division, coordinate by coordinate.