#include <vector_constraint.h>
Class diagram for vector_constraint:

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... | |
Definition at line 39 of file vector_constraint.h.
| vector_constraint::vector_constraint (const double u, const double x1, const double y1) |
The only constructor for an angle_constraint.
| 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
|
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.
| tol | is a dimensionless calculation tolerance. |
| p | are the point positions. |
| e | the energy. |
| dedp |
is the rate of change of energy with position.
|
assert( p.size() == 2 ); assert( 0 < tol && tol < 1 );
assert( dedp.size() == 2 );
Reimplemented from constraint.
Definition at line 66 of file vector_constraint.cpp.
void assoc (vector_constraint & c, vector2 & p0, vector2 & p1) [friend]
|
Associates a vector_constraint with the 2 points it constrains.
assert( !c.points()[0] );
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.
assert( !c.points()[0] ); assert( !c.points()[1] );
Definition at line 203 of file vector_constraint.h.
| 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.
1.0.0 written by Dimitri van Heesch,
© 1997-1999