CanvasLib
Loading...
Searching...
No Matches
canv::Vec2< T > Class Template Reference

Utility Vec2 class with x, y coordinates. More...

#include <Vec2.hpp>

Public Member Functions

 Vec2 ()
 creates Vec2 with 0, 0 coordinates
 
 Vec2 (T x, T y)
 
template<typename U >
auto DistToSquared (const Vec2< U > &other)
 returns distance^2 to other point
 
template<typename U >
auto DistTo (const Vec2< U > &other)
 returns distance to other point
 
auto AsTuple () const -> std::tuple< T, T >
 
template<typename U >
auto operator+= (const Vec2< U > &other) -> Vec2< T > &
 
template<typename U >
auto operator-= (const Vec2< U > &other) -> Vec2< T > &
 
 operator std::string ()
 

Public Attributes

T X
 
T Y
 

Friends

template<typename U >
auto operator<< (std::ostream &, const Vec2< U > &) -> std::ostream &
 
template<typename R , typename U >
auto operator* (const Vec2< R > &vec, const U &value) -> Vec2< R >
 
template<typename R , typename U >
auto operator* (const U &value, const Vec2< R > &vec) -> Vec2< R >
 

Detailed Description

template<typename T>
class canv::Vec2< T >

Utility Vec2 class with x, y coordinates.

Template Parameters
CoordTypeis type of x, y fields

The documentation for this class was generated from the following file: