Main Page   Namespace List   Class Hierarchy   Compound List   File List   Header Files   Sources   Namespace Members   Compound Members   File Members  

vector_constraint Class Reference

Constrain the relative position of two points. More...

#include <vector_constraint.h>

Class diagram for vector_constraint:

constraint

List of all members.


Public Members

 vector_constraint ( const double u, const double x1, const double y1 )
The only constructor for an angle_constraint. More...

virtual ~vector_constraint (void)
virtual void energy ( const double tol, const vector< vector2 > &p, double &e, vector< vector2 > &dedp ) const
Calculate a dimensionless measure of the potential energy (e) of the constraint. More...

double x
The x coordinate of the expected position of points()[1], relative to points()[0].

double y
The y coordinate of the expected position of points()[1], relative to points()[0].


Friends

void assoc ( vector_constraint &c, vector2 &p0, vector2 &p1 )
Associates a vector_constraint with the 2 points it constrains. More...

void unassoc ( vector_constraint &c )
Disassociates a vector_constraint from the points it constrains. More...


Detailed Description

Constrain the relative position of two points.

Definition at line 39 of file vector_constraint.h.


Member Function Documentation

vector_constraint::vector_constraint (const double u, const double x1, const double y1)

The only constructor for an angle_constraint.

Parameters:
u   the degree of uncertainty of the constriant.
x1   the x coordinate of the relative position of the two points
y1   the y coordinate of the relative position of the two points

Postconditions:
 assert( this->uncertainty() == u );
 assert( this->x == x1 );
 assert( this->y == y1 );
 assert( this->points().size() == 2 );

Definition at line 36 of file vector_constraint.cpp.

vector_constraint::~vector_constraint (void) [virtual]

Definition at line 59 of file vector_constraint.cpp.

void vector_constraint::energy (const double tol, const vector<vector2>& p, double & e, vector<vector2>& dedp) const [virtual]

Calculate a dimensionless measure of the potential energy (e) of the constraint.

This is equivalent to a measure of how poorly the constraint is satisfied. If *(this->points()[i]) had position p[i], it calculates the energy (e) and the rates of change of that energy (dedp) with respect to the point positions. Larger values indicate the constraint is less well satisfied. 0 is the minimum possible energy, and energy <= 1 indicates that the constraint is satisifed to within the uncertainty of the constraint.

Parameters:
tol   is a dimensionless calculation tolerance.
p   are the point positions.
Return values:
e   the energy.
dedp   is the rate of change of energy with position.

Preconditions:
 assert( p.size() == 2 );
 assert( 0 < tol && tol < 1 );

Postconditions:
 assert( dedp.size() == 2 );

Reimplemented from constraint.

Definition at line 66 of file vector_constraint.cpp.


Friends And Related Function Documentation

void assoc (vector_constraint & c, vector2 & p0, vector2 & p1) [friend]

Associates a vector_constraint with the 2 points it constrains.

Preconditions:
 assert( !c.points()[0] );

Postconditions:
 assert( c.points()[0] == &p0 );
 assert( c.points()[1] == &p1 );

Definition at line 184 of file vector_constraint.h.

void unassoc (vector_constraint & c) [friend]

Disassociates a vector_constraint from the points it constrains.

Postconditions:
 assert( !c.points()[0] );
 assert( !c.points()[1] );

Definition at line 203 of file vector_constraint.h.


Member Data Documentation

double vector_constraint::x

The x coordinate of the expected position of points()[1], relative to points()[0].

Definition at line 110 of file vector_constraint.h.

double vector_constraint::y

The y coordinate of the expected position of points()[1], relative to points()[0].

Definition at line 116 of file vector_constraint.h.


The documentation for this class was generated from the following files:
Generated at Sun Jul 14 20:38:22 2002 for Mapper by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999