#pragma once
#include <cstdlib>
#include <cmath>
namespace msdfgen {
struct Vector2 {
double x, y;
Vector2(double val = 0);
Vector2(double x, double y);
void reset();
void set(double x, double y);
double length() const;
double direction() const;
Vector2 normalize(bool allowZero = false) const;
Vector2 getOrthogonal(bool polarity = true) const;
Vector2 getOrthonormal(bool polarity = true, bool allowZero = false) const;
Vector2 project(const Vector2 &vector, bool positive = false) const;
operator const void *() const;
bool operator!() const;
bool operator==(const Vector2 &other) const;
bool operator!=(const Vector2 &other) const;
Vector2 operator+() const;
Vector2 operator-() const;
Vector2 operator+(const Vector2 &other) const;
Vector2 operator-(const Vector2 &other) const;
Vector2 operator*(const Vector2 &other) const;
Vector2 operator/(const Vector2 &other) const;
Vector2 operator*(double value) const;
Vector2 operator/(double value) const;
Vector2 & operator+=(const Vector2 &other);
Vector2 & operator-=(const Vector2 &other);
Vector2 & operator*=(const Vector2 &other);
Vector2 & operator/=(const Vector2 &other);
Vector2 & operator*=(double value);
Vector2 & operator/=(double value);
friend double dotProduct(const Vector2 &a, const Vector2 &b);
friend double crossProduct(const Vector2 &a, const Vector2 &b);
friend Vector2 operator*(double value, const Vector2 &vector);
friend Vector2 operator/(double value, const Vector2 &vector);
};
typedef Vector2 Point2;
}