2 gph-math - math library for graphics programs
3 Copyright (C) 2016 John Tsiombikas <nuclear@member.fsf.org>
5 This program is free software. Feel free to use, modify, and/or redistribute
6 it under the terms of the MIT/X11 license. See LICENSE for details.
7 If you intend to redistribute parts of the code without the LICENSE file
8 replace this paragraph with the full contents of the LICENSE file.
10 inline void Vector2::normalize()
12 float len = (float)sqrt(x * x + y * y);
19 inline float &Vector2::operator[] (int idx)
21 return idx == 0 ? x : y;
24 inline const float &Vector2::operator[] (int idx) const
26 return idx == 0 ? x : y;