sugr
Class Line_2D

java.lang.Object
  extended bysugr.Element
      extended bysugr.Entity
          extended bysugr.Object_2D
              extended bysugr.Line_2D
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Line_2D
extends Object_2D

Implementation of Line_2D

Version:
1.1 (25.1.2004) Changed: Changed Constructor Line_2D(Point,Point) to not use Construction Class anymore. Included calculations into Constructor itself. By Achim Königs
Author:
Norbert Fischer
See Also:
Serialized Form

Field Summary
private static int DIM
           
private static int DOF
           
private static long serialVersionUID
          Class version number for serialization
 
Fields inherited from class sugr.Element
cov, MAXITER, v
 
Constructor Summary
Line_2D()
          Default constructor
Line_2D(double angle, double distance)
          Angle-distance constructor for Line_2D.
Line_2D(double u, double v, double w)
          Creates a new Line_2D.
Line_2D(double u, double v, double w, Matrix cov)
          Creates a new Line_2D with covariance matrix.
Line_2D(double angle, double distance, Matrix cov)
          Angle-distance constructor for Line_2D with covariance.
Line_2D(Point_2D x, Point_2D y)
          Creates a line be two Point_2D.
Line_2D(RelationalProperty[] rprops)
          Estimates a new line.
Line_2D(Vector _v, Matrix _cov)
          Constructor for a new Line_2D
 
Method Summary
 Line_2D copy()
          returns a copy of this line.
protected  Matrix getConditionMatrix(double f)
          Get a matrix W(f) for conditioning.
 Matrix getCovarianceOfJacobianRowOfRelation(java.lang.Class relationType, java.lang.Class partnerType, int row)
          Return Covariance of a Row of the Jacobian Matrix of that entity in combination with a relation.
 int getDegreesOfFreedom()
          returns dof=2 of this line
 int getDimension()
          returns the dimension of this line=3
 double getDistance(Entity e)
          calculates the distance between this line and a Point_2D
 int getDofOfRelation(java.lang.Class relationType, java.lang.Class partnerType)
           Compute degrees of freedom of a relation.
 Vector getEuclideanPart()
          returns the euclidean part of this line
 Vector getHomogeneousPart()
          returns the homogeneous part of this plane
 Matrix getJacobianOfRelation(java.lang.Class relationType, java.lang.Class partnerType)
          Return Jacobian Matrix of that entity in combination with a relation.
 void normalizeEuclidean()
          normalizes in that way, that the homogeneous part will be 1
 Matrix SkewSym()
          returns the skew symmetric matrix of this line
static Matrix SkewSym(Vector v)
          returns the skew symmetic matrix of a vector
 
Methods inherited from class sugr.Entity
doCondition, doCondition, doCondition, ensureConstraintsWithoutIteration, getConditionFactorF, getConditionFactorF, getDistanceToOrigin, getJacobianOfRelation, getNormOfEuclideanPart, getNormOfHomogeneousPart, isEqual, isIncident, isOrthogonal, isParallel, normalizeEuclideanComparable, transform
 
Methods inherited from class sugr.Element
approximate, calcCov, changeNullspace, changeNullspace, checkCovDim, checkElement, clone, ensureConstraints, estimate, estimate, gaussHelmertIterations, gaussHelmertIterationsOld, getConstraintValue, getCov, getJacobianOfConstraint, getReducedAB, getV, normalizeSphere, normalizeSphereComparable, print, print, reduceFirstMatrix, reduceMatrix, reduceMatrix, setCov, setV, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Class version number for serialization

See Also:
Constant Field Values

DIM

private static final int DIM
See Also:
Constant Field Values

DOF

private static final int DOF
See Also:
Constant Field Values
Constructor Detail

Line_2D

public Line_2D(Vector _v,
               Matrix _cov)
Constructor for a new Line_2D

Parameters:
_v - a Vector with dimension 3. Contains the coordinates of the new Line_2D
_cov - 3x3 covariance matrix

Line_2D

public Line_2D(Point_2D x,
               Point_2D y)
Creates a line be two Point_2D. Error propagation is done automatically

Parameters:
x - first Point_2D
y - second Point_2D

Line_2D

public Line_2D(double u,
               double v,
               double w)
Creates a new Line_2D. This line has no error, covariance matrix is set to 0

Parameters:
u - homogeneous part
v - homogeneous part
w - euklidean part

Line_2D

public Line_2D(double u,
               double v,
               double w,
               Matrix cov)
Creates a new Line_2D with covariance matrix.

Parameters:
u - homogeneous part
v - homogeneous part
w - euclidean part
cov - 3x3 Matrix

Line_2D

public Line_2D(double angle,
               double distance)
Angle-distance constructor for Line_2D. Note that Line_2D has degree of freedom 2, so this is constructor with least parameters

Parameters:
angle - angle between normal of line and x-axis
distance - distance from origin

Line_2D

public Line_2D(double angle,
               double distance,
               Matrix cov)
Angle-distance constructor for Line_2D with covariance. Note that Line_2D has degree of freedom 2, so this is constructor with least parameters

Parameters:
angle - angle between normal of line and x-axis
distance - distance from origin
cov - 3x3 Matrix TODO: Give 2x2 covariance of angle and distance instead of covariance of line parameters

Line_2D

public Line_2D()
Default constructor


Line_2D

public Line_2D(RelationalProperty[] rprops)
Estimates a new line.

Parameters:
rprops - an array of constraints.
Method Detail

getEuclideanPart

public Vector getEuclideanPart()
returns the euclidean part of this line

Specified by:
getEuclideanPart in class Entity
Returns:
a Vector with 1 element

getHomogeneousPart

public Vector getHomogeneousPart()
returns the homogeneous part of this plane

Specified by:
getHomogeneousPart in class Entity
Returns:
a Vector with 2 elements

getDistance

public double getDistance(Entity e)
calculates the distance between this line and a Point_2D

Specified by:
getDistance in class Entity
Parameters:
e - Point_2D to calculate distance to
Returns:
a positive double containing the distance

getConditionMatrix

protected Matrix getConditionMatrix(double f)
Get a matrix W(f) for conditioning. This matrix can be used to transform an entity to a conditioned one.

Specified by:
getConditionMatrix in class Entity
Parameters:
f - the conditioning factor
Returns:
the condition matrix

copy

public Line_2D copy()
returns a copy of this line. Actually it clones a Line_2D.


getDimension

public int getDimension()
returns the dimension of this line=3

Specified by:
getDimension in class Element

getDegreesOfFreedom

public int getDegreesOfFreedom()
returns dof=2 of this line

Specified by:
getDegreesOfFreedom in class Entity

SkewSym

public Matrix SkewSym()
returns the skew symmetric matrix of this line

Returns:
3x3 Matrix with rank 2

SkewSym

public static Matrix SkewSym(Vector v)
returns the skew symmetic matrix of a vector

Returns:
3x3 Matrix with rank 2

normalizeEuclidean

public void normalizeEuclidean()
normalizes in that way, that the homogeneous part will be 1

Specified by:
normalizeEuclidean in class Entity

getJacobianOfRelation

public Matrix getJacobianOfRelation(java.lang.Class relationType,
                                    java.lang.Class partnerType)
                             throws java.lang.IllegalArgumentException
Return Jacobian Matrix of that entity in combination with a relation. If that entity is part of a relation then this relation has a constraint f(firstEntity)*secondEntity=g(secondEntity)*firstEntity=0. f and g are the Jacobians of these linear formulas. So return f or g (the choice f or g is given by the type of the entity !)

Specified by:
getJacobianOfRelation in class Entity
Parameters:
relationType - the type of the relation
partnerType - the type of the other partner in the relation
Returns:
Jacobian matrix (or part of the constraint formula)
Throws:
java.lang.IllegalArgumentException

getDofOfRelation

public int getDofOfRelation(java.lang.Class relationType,
                            java.lang.Class partnerType)
                     throws java.lang.IllegalArgumentException

Compute degrees of freedom of a relation.

Specified by:
getDofOfRelation in class Entity
Parameters:
relationType - the type of the relation
partnerType - the type of the other partner in the relation
Returns:
degrees of freedom for the relation

Throws:
java.lang.IllegalArgumentException

getCovarianceOfJacobianRowOfRelation

public Matrix getCovarianceOfJacobianRowOfRelation(java.lang.Class relationType,
                                                   java.lang.Class partnerType,
                                                   int row)
                                            throws java.lang.IllegalArgumentException
Return Covariance of a Row of the Jacobian Matrix of that entity in combination with a relation.

Specified by:
getCovarianceOfJacobianRowOfRelation in class Entity
Parameters:
relationType - the type of the relation
partnerType - the type of the other partner in the relation
Returns:
Covariance of the row of the Jacobian matrix
Throws:
java.lang.IllegalArgumentException