better g2chromatic.cpp

This commit is contained in:
yggdrasil75
2025-11-12 20:00:14 -05:00
parent f64842d142
commit ee5783e0e6
3 changed files with 75 additions and 25 deletions

View File

@@ -260,6 +260,11 @@ class Vec2 {
float angleTo(const Vec2& other) const {
return std::acos(this->dot(other) / (this->length() * other.length()));
}
float directionTo(const Vec2& other) const {
Vec2 direction = other - *this;
return direction.angle();
}
float& operator[](int index) {
return (&x)[index];