|
| Coord (T ix, T iy) |
|
| Coord (std::vector< T > v) |
|
| operator Coord< float > () const |
|
| operator Coord< double > () const |
|
Coord< T > | operator+ (const Coord< T > &a) const |
|
Coord< T > | operator- (const Coord< T > &a) const |
|
Coord< T > | operator* (const Coord< T > &a) const |
|
Coord< T > | operator* (T r) const |
|
Coord< T > | operator/ (T r) const |
|
bool | operator== (const Coord< T > &a) const |
|
bool | operator!= (const Coord< T > &a) const |
|
bool | operator< (const Coord< T > &a) const |
|
Coord< T > | rotate (T a) const |
|
Coord< int64_t > | to_coordi () const |
|
T | dot (const Coord< T > &a) const |
|
T | cross (const Coord< T > &other) const |
|
T | mag_sq () const |
|
T | mag () const |
|
Coord< T > | normalize () const |
|
double | magd () const |
|
std::conditional_t< std::is_same_v< T, float >, float, double > | angle () const |
|
bool | in_range (const Coord< T > &a, const Coord< T > &b) const |
|
void | operator+= (const Coord< T > a) |
|
void | operator-= (const Coord< T > a) |
|
void | operator*= (T a) |
|
std::array< T, 2 > | as_array () const |
|
template<typename T>
class horizon::Coord< T >
Your typical coordinate class.
Supports some mathematical operators as required. Unless otherwise noted, 1 equals 1 nm (that is nanometer, not nautical mile) Instead of instantiating the template on your own, you want to use Coordf (float) for calculations that will end up only on screen and Coordi (int64_t) for everything else.