sugr
Class Line_3D

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

public class Line_3D
extends Object_3D

Implementation of Line_3D

Version:
1.3 (17.5.2004) Changed some comments. Changed getDual() to give back the expected Line, not scaled with -1, 1.2 (25.1.2004) Changed Constructor Line_3D(Point,Point) and Line_3D(Plane,Plane) to not use Construction Class anymore, calculation is done in Constructor itself now. By Achim Königs, 1.1 (9.2.2003) Fixed: getJacobianHomogeneousPart() returned wrong matrix
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
private static double ZERO_THRESHOLD_CONSTR
          Threshold for zero used in constructors for checking pluecker condition.
 
Fields inherited from class sugr.Element
cov, MAXITER, v
 
Constructor Summary
Line_3D()
          Default constructor
Line_3D(BiRelationalProperty[] rprops)
          estimates a new line.
Line_3D(double l1, double l2, double l3, double l4, double l5, double l6)
          Creates a new Line_3D by specifying all elements directly.
Line_3D(double l1, double l2, double l3, double l4, double l5, double l6, Matrix cov)
          Creates a new Line_3D with covariance by specifying all elements directly.
Line_3D(double l1, double l2, double l3, double l4, double l5, double l6, Matrix cov, boolean testPlueckerCondition)
          Creates a new Line_3D with covariance by specifying all elements directly.
Line_3D(Plane_3D plane1, Plane_3D plane2)
          Creates a Line_3D by an intersection of two Plane_3D.
Line_3D(Point_3D point1, Point_3D point2)
          Creates a Line_3D from two Point_3D.
Line_3D(Vector _v, Matrix _cov)
          Constructor for a new Line_3D
 
Method Summary
 boolean checkPlueckerCondition(double zero_threshold)
          Check the pluecker condition.
 Line_3D copy()
          Returns a copy of this line.
static Matrix DualMatrixC()
          Get the dualization matrix C with LDual=C*L.
 Matrix Gamma()
          Returns the gamma matrix of this line
static Matrix Gamma(Vector v)
          Returns the gamma matrix of a 6x1 vector.
 Matrix GammaDual()
          Returns the gamma-dual of this line.
static Matrix GammaDual(Vector v)
          Returns the gamma-dual of a 6x1 vector.
protected  Matrix getConditionMatrix(double f)
          Get a matrix W(f) for conditioning.
protected  Vector getConstraintValue()
          Get the value of the constraint (h(beta) or g(y)) if this entity is an unknown or an observation.
 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=4 for this line
 Matrix getDeltaMatrix(int i)
          Compute Matrix Delta_i of this line.
 int getDimension()
          Returns dimension=6
 double getDistance(Entity e)
          Compute the (euclidean) distance to another entity.
 int getDofOfRelation(java.lang.Class relationType, java.lang.Class partnerType)
           Compute degrees of freedom of a relation.
 Line_3D getDual()
          Create a new Line, which is the Dual of this line.
 Vector getEuclideanPart()
          returns the euclidean part of this line
 Vector getHomogeneousPart()
          returns the homogeneous part of this plane
 Matrix getJacobianOfConstraint()
          Get the Jacobian of the constraint (H, G) if this entity is an unkown or an observation
 Matrix getJacobianOfRelation(java.lang.Class relationType, java.lang.Class partnerType)
          Return Jacobian Matrix of that entity in combination with a relation.
 Matrix getLineLineJacobian()
          Returns the 16x6 jacobi-matrix for the line-equality-test This formula is from the dissertation (3.70).
protected  Matrix[] getReducedAB(RelationalProperty rprop)
          Get the reduced Matrix A and B from a relational property.
 Matrix getReducedDeltaMatrix(int i)
          Compute reduced Matrix Delta_i of this line.
static Matrix JGamma()
          Get the Matrix JGamma. vec(GammaDual(L)) = JGamma*C*L.
 void normalizeEuclidean()
          Normalizes in that way, that the homogeneous part will be 1
 
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, getCov, 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

ZERO_THRESHOLD_CONSTR

private static final double ZERO_THRESHOLD_CONSTR
Threshold for zero used in constructors for checking pluecker condition. This threshold is not very accurate.

See Also:
Constant Field Values
Constructor Detail

Line_3D

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

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

Line_3D

public Line_3D(double l1,
               double l2,
               double l3,
               double l4,
               double l5,
               double l6)
Creates a new Line_3D by specifying all elements directly. covariance matrix is set to 0 so it has no error Be careful: The Line must fullfill the Pluecker condition ! This is NOT tested !


Line_3D

public Line_3D(double l1,
               double l2,
               double l3,
               double l4,
               double l5,
               double l6,
               Matrix cov)
Creates a new Line_3D with covariance by specifying all elements directly.

Parameters:
cov - 6x6 Matrix

Line_3D

public Line_3D(double l1,
               double l2,
               double l3,
               double l4,
               double l5,
               double l6,
               Matrix cov,
               boolean testPlueckerCondition)
Creates a new Line_3D with covariance by specifying all elements directly.

Parameters:
cov - 6x6 Matrix
testPlueckerCondition - if false do NOT test pluecker condition. Be careful with that, because if Pluecker condition is not met, this is not a 3D-Line !.

Line_3D

public Line_3D(Plane_3D plane1,
               Plane_3D plane2)
Creates a Line_3D by an intersection of two Plane_3D. Error propagation is done automatically

Parameters:
plane1 - first Plane_3D
plane2 - second Plane_3D

Line_3D

public Line_3D(BiRelationalProperty[] rprops)
estimates a new line.

Parameters:
rprops - an array of constraints.

Line_3D

public Line_3D(Point_3D point1,
               Point_3D point2)
Creates a Line_3D from two Point_3D. Error propagation is done automatically

Parameters:
point1 - first Point_3D
point2 - second Point_3D

Line_3D

public Line_3D()
Default constructor

Method Detail

checkPlueckerCondition

public boolean checkPlueckerCondition(double zero_threshold)
Check the pluecker condition.

Parameters:
zero_threshold - a threshold for the scalarproduct beeing zero.
Returns:
true if pluecker condition is ok, otherwise false

getDual

public Line_3D getDual()
Create a new Line, which is the Dual of this line. Note that the complete line is dualized, also the covariance matrix

Returns:
a Line_3D

getEuclideanPart

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

Specified by:
getEuclideanPart in class Entity
Returns:
a Vector with 3 elements

getHomogeneousPart

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

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

getDistance

public double getDistance(Entity e)
Compute the (euclidean) distance to another entity. This is of course not possible for all combinations. In the case of an illegal combination an IllegalArgumentException should be thrown.

Specified by:
getDistance in class Entity
Parameters:
e - the entity to which a distance should be computed.
Returns:
the distance to the given entity

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_3D copy()
Returns a copy of this line. Actually it works like clone


getDimension

public int getDimension()
Returns dimension=6

Specified by:
getDimension in class Element

getDegreesOfFreedom

public int getDegreesOfFreedom()
Returns dof=4 for this line

Specified by:
getDegreesOfFreedom in class Entity

GammaDual

public static Matrix GammaDual(Vector v)
Returns the gamma-dual of a 6x1 vector. This matrix differs from that of the dissertation in the sign, because of other definition of C


GammaDual

public Matrix GammaDual()
Returns the gamma-dual of this line. This matrix differs from that of the dissertation in the sign, because of other definition of C


Gamma

public static Matrix Gamma(Vector v)
Returns the gamma matrix of a 6x1 vector.


Gamma

public Matrix Gamma()
Returns the gamma matrix of this line


getLineLineJacobian

public Matrix getLineLineJacobian()
Returns the 16x6 jacobi-matrix for the line-equality-test This formula is from the dissertation (3.70). Note that the different definition of the sign of C influences this result !

Returns:
16x6 jacobi-matrix

getReducedAB

protected Matrix[] getReducedAB(RelationalProperty rprop)
Get the reduced Matrix A and B from a relational property. A is the Jacobian of this Entity (the unknown), B is the Jacobian of the observation (the relational property). The Jacobian of the oberservation depends (only) on the unknown and the Jacobian of the unknown depends (only) of the oberservation ! This method is overwritten to handle some the special cases.

Overrides:
getReducedAB in class Element
Parameters:
rprop - the relational Property
Returns:
A in array element 0, B in array Element 1.

getDeltaMatrix

public Matrix getDeltaMatrix(int i)
Compute Matrix Delta_i of this line. The matrix delta_i is delta_i(L)=L*E_i.trans + L_i * I (defined in eq. 3.68 of PhD from Stephan Heuel, ipb.) This is used for the reduced Jacobian matrixes.

Parameters:
i - : The index i=0, ..., 5 for which Matrix delta is built.
Returns:
the matrix delta_i

getReducedDeltaMatrix

public Matrix getReducedDeltaMatrix(int i)
Compute reduced Matrix Delta_i of this line. The reduced Matrix two rows are omitted: The i.th (which is always zero) and the (i+3) modulo 6, because for this row the pluecker condition is not met. This is used for the reduced Jacobian matrixes.

Parameters:
i - : The index i=0, ..., 5 for which Matrix delta is built.
Returns:
the matrix delta_i

normalizeEuclidean

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

Specified by:
normalizeEuclidean in class Entity

getConstraintValue

protected Vector getConstraintValue()
Get the value of the constraint (h(beta) or g(y)) if this entity is an unknown or an observation. This is the length constraint and for 3D-Lines also the plücker condition.

Overrides:
getConstraintValue in class Element
Returns:
the value of the constraint as a vector.

getJacobianOfConstraint

public Matrix getJacobianOfConstraint()
Get the Jacobian of the constraint (H, G) if this entity is an unkown or an observation

Overrides:
getJacobianOfConstraint in class Element
Returns:
the Jacobian as a matrix.

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

JGamma

public static Matrix JGamma()
Get the Matrix JGamma. vec(GammaDual(L)) = JGamma*C*L. This matrix differs from that of the dissertation because of other definition of C


DualMatrixC

public static Matrix DualMatrixC()
Get the dualization matrix C with LDual=C*L. This matrix differs from that of the dissertation in the sign !