Open PaperOpt
OpenPaperOpt/V2.h File Reference
#include <math.h>
Include dependency graph for V2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  V2< T >

Defines

#define PI   3.1415926535897932384626433832795
#define AREA(V1, V2, V3, V4)   (fabs(0.5*((V1).X()*(V2).Y()+(V2).X()*(V3).Y()+(V3).X()*(V4).Y()+(V4).X()*(V1).Y()-(V2).X()*(V1).Y()-(V3).X()*(V2).Y()-(V4).X()*(V3).Y()-(V1).X()*(V4).Y())))
#define AREA0(V2, V3, V4)   (fabs(0.5*((V2).X()*(V3).Y()+(V3).X()*(V4).Y()-(V3).X()*(V2).Y()-(V4).X()*(V3).Y())))

Functions

template<class T >
V2< T > operator+ (const V2< T > &a, const V2< T > &b)
template<class T >
V2< T > operator- (const V2< T > &a, const V2< T > &b)
template<class T >
operator* (const V2< T > &a, const V2< T > &b)
template<class T >
V2< T > operator* (const V2< T > &a, T f)
template<class T >
V2< T > operator/ (const V2< T > &a, T f)
template<class T >
V2< T > elemMul (const V2< T > &a, const V2< T > &b)
template<class T >
int CrossLineToLineseg (const V2< T > &a1, const V2< T > &a2, const V2< T > &b1, const V2< T > &b2)

Define Documentation

#define AREA (   V1,
  V2,
  V3,
  V4 
)    (fabs(0.5*((V1).X()*(V2).Y()+(V2).X()*(V3).Y()+(V3).X()*(V4).Y()+(V4).X()*(V1).Y()-(V2).X()*(V1).Y()-(V3).X()*(V2).Y()-(V4).X()*(V3).Y()-(V1).X()*(V4).Y())))
#define AREA0 (   V2,
  V3,
  V4 
)    (fabs(0.5*((V2).X()*(V3).Y()+(V3).X()*(V4).Y()-(V3).X()*(V2).Y()-(V4).X()*(V3).Y())))
#define PI   3.1415926535897932384626433832795

Function Documentation

template<class T >
int CrossLineToLineseg ( const V2< T > &  a1,
const V2< T > &  a2,
const V2< T > &  b1,
const V2< T > &  b2 
) [inline]
Returns:
true if linesegment (b1->b2) cross line through {a1,a2}

algorithm: Determine line equation of a on the form p*n=d Insert b1,b2 in p*n-d and check if same sign => no crossing

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
V2<T> elemMul ( const V2< T > &  a,
const V2< T > &  b 
) [inline]

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
T operator* ( const V2< T > &  a,
const V2< T > &  b 
) [inline]

Here is the call graph for this function:

template<class T >
V2<T> operator* ( const V2< T > &  a,
f 
) [inline]

Here is the call graph for this function:

template<class T >
V2<T> operator+ ( const V2< T > &  a,
const V2< T > &  b 
) [inline]

Here is the call graph for this function:

template<class T >
V2<T> operator- ( const V2< T > &  a,
const V2< T > &  b 
) [inline]

Here is the call graph for this function:

template<class T >
V2<T> operator/ ( const V2< T > &  a,
f 
) [inline]