FormIt C++ API  v23.0.0 (2023.0.0)
WSM::Point2d Class Reference

Description

The Point2d class stores a point in 2D space.

The coordinates of the point are accessed via public data members, x and y, or via the subscript operator, index 0 being the x-coordinate and index 1 being the y-coordinate.

#include <Point2d.h>

Public Member Functions

 Point2d ()
 
 Point2d (double xx, double yy)
 
Point2d operator+ (const Point2d &p) const
 
Point2d operator+ (const Vector2d &v) const
 
Vector2d operator- (const Point2d &p) const
 
Point2d operator- (const Vector2d &v) const
 
Point2d operator- () const
 
Point2d operator* (double scalar) const
 
Point2d operator/ (double scalar) const
 
double operator% (const Vector2d &v) const
 
double operator[] (size_t index) const
 
double & operator[] (size_t index)
 
double length () const
 
double lengthSqrd () const
 
double lengthRect () const
 
double dist (const Point2d &p) const
 
double distSqrd (const Point2d &p) const
 
double distRect (const Point2d &p) const
 
bool isEqual (const Point2d &p, double epsSqrd=WSM_DISTANCE_TOL2) const
 
bool isEqualRect (const Point2d &p, double epsRect=WSM_DISTANCE_TOL) const
 
Point2dset (double xx, double yy)
 
Point2dzero ()
 
Point2dscale (const Vector2d &v)
 
Point2d getScaled (const Vector2d &v) const
 
void operator+= (const Point2d &p)
 
void operator+= (const Vector2d &v)
 
void operator-= (const Point2d &p)
 
void operator-= (const Vector2d &v)
 
void operator*= (double scalar)
 
void operator/= (double scalar)
 
bool isValid () const
 
Vector2d toVector2d () const
 
void rotate (double aRad)
 

Static Public Member Functions

static double det (const WSM::Point2d &a, const WSM::Point2d &b)
 

Public Attributes

double x
 
double y
 

Static Public Attributes

static const Point2d kNull
 

Constructor & Destructor Documentation

WSM::Point2d::Point2d ( )
inline
WSM::Point2d::Point2d ( double  xx,
double  yy 
)
inline

Member Function Documentation

static double WSM::Point2d::det ( const WSM::Point2d a,
const WSM::Point2d b 
)
inlinestatic
double WSM::Point2d::dist ( const Point2d p) const
inline
double WSM::Point2d::distRect ( const Point2d p) const
inline
double WSM::Point2d::distSqrd ( const Point2d p) const
inline
Point2d WSM::Point2d::getScaled ( const Vector2d v) const
inline
bool WSM::Point2d::isEqual ( const Point2d p,
double  epsSqrd = WSM_DISTANCE_TOL2 
) const
inline
bool WSM::Point2d::isEqualRect ( const Point2d p,
double  epsRect = WSM_DISTANCE_TOL 
) const
inline
bool WSM::Point2d::isValid ( ) const
inline
double WSM::Point2d::length ( ) const
inline
double WSM::Point2d::lengthRect ( ) const
inline
double WSM::Point2d::lengthSqrd ( ) const
inline
double WSM::Point2d::operator% ( const Vector2d v) const
inline
Point2d WSM::Point2d::operator* ( double  scalar) const
inline
void WSM::Point2d::operator*= ( double  scalar)
inline
Point2d WSM::Point2d::operator+ ( const Point2d p) const
inline
Point2d WSM::Point2d::operator+ ( const Vector2d v) const
inline
void WSM::Point2d::operator+= ( const Point2d p)
inline
void WSM::Point2d::operator+= ( const Vector2d v)
inline
Vector2d WSM::Point2d::operator- ( const Point2d p) const
inline
Point2d WSM::Point2d::operator- ( const Vector2d v) const
inline
Point2d WSM::Point2d::operator- ( ) const
inline
void WSM::Point2d::operator-= ( const Point2d p)
inline
void WSM::Point2d::operator-= ( const Vector2d v)
inline
Point2d WSM::Point2d::operator/ ( double  scalar) const
inline
void WSM::Point2d::operator/= ( double  scalar)
inline
double WSM::Point2d::operator[] ( size_t  index) const
inline
double& WSM::Point2d::operator[] ( size_t  index)
inline
void WSM::Point2d::rotate ( double  aRad)
Point2d& WSM::Point2d::scale ( const Vector2d v)
inline
Point2d& WSM::Point2d::set ( double  xx,
double  yy 
)
inline
Vector2d WSM::Point2d::toVector2d ( ) const
inline
Point2d& WSM::Point2d::zero ( )
inline

Member Data Documentation

const Point2d WSM::Point2d::kNull
static
double WSM::Point2d::x
double WSM::Point2d::y

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