Xmipp  v3.23.11-Nereus
Functions
Bilib Geometry
Collaboration diagram for Bilib Geometry:

Functions

int AffineToRotationMatrix (double *A, double *R, double *xRotation, double *yRotation, double *zRotation, int FirstOctant, double Tolerance, long MaxIterations, int *Status)
 
int GetRotationMatrix (double *R, double xRotation, double yRotation, double zRotation)
 
int GetScalingMatrix (double *S, double xScale, double yScale, double zScale)
 
int GetTranslationMatrix (double *T, double xTranslation, double yTranslation, double zTranslation)
 
int LineToLineIntersection (double P[], double Q[], double A[], double B[], double X[], long Lines, double Tolerance, long MaxIterations, int *Intersection, int *Status)
 
int LineToLineIntersection3D (double P[], double q[], double A[], double b[], double X[], double Tolerance, int *Intersection)
 
int LineToPlaneIntersection (double P[], double Q[], double A[], double B[], double C[], double X[], long Lines, double Tolerance, long MaxIterations, int *Intersection, int *Status)
 
int LineToPlaneIntersection3D (double P[], double q[], double A[], double b[], double X[], double Tolerance, int *Intersection)
 
int PointsToLine3D (double P[], double Q[], double A[], double b[], double Tolerance)
 
int PointsToPlane3D (double P[], double Q[], double R[], double A[], double b[], double Tolerance)
 
int PointToLineMembership (double P[], double A[], double B[], long Lines, double Tolerance, int *Membership, int *Status)
 
int PointToLineMembership3D (double P[], double A[], double b[], double Tolerance, int *Membership)
 
int PointToPlaneMembership (double P[], double A[], double B[], double C[], long Lines, double Tolerance, long MaxIterations, int *Membership, int *Status)
 
int PointToPlaneMembership3D (double P[], double A[], double b[], double Tolerance, int *Membership)
 
int ProjectPointToLine (double P[], double A[], double B[], double X[], long Lines, double Tolerance)
 
int ProjectPointToLine3D (double P[], double A[], double b[], double X[], double Tolerance)
 
int ProjectPointToPlane (double P[], double A[], double B[], double C[], double X[], long Lines, double Tolerance, long MaxIterations, int *Status)
 
int ProjectPointToPlane3D (double P[], double A[], double b[], double X[], double Tolerance)
 
int TestColinearVector (double U[], double V[], long Lines, double Tolerance, int *Colinear)
 
int TestCoplanarVector (double U[], double V[], double W[], long Lines, double Tolerance, long MaxIterations, int *Coplanar, int *Status)
 

Detailed Description

Function Documentation

◆ AffineToRotationMatrix()

int AffineToRotationMatrix ( double *  A,
double *  R,
double *  xRotation,
double *  yRotation,
double *  zRotation,
int  FirstOctant,
double  Tolerance,
long  MaxIterations,
int *  Status 
)

Affine -> Rotation matrix. Approximate a (4 x 4) homogenous affine matrix by a (4 x 4) rotation matrix. The rotation matrix has the form R = Rx.Ry.Rz.

A and R are homogenous: (A, R) = {{*, *, *, 0}, {*, *, *, 0}, {*, *, *, 0}, {0, 0, 0, 1}}

The returned rotation angles are given in the unit of radian.

success: return(!ERROR); failure: return(ERROR)

◆ GetRotationMatrix()

int GetRotationMatrix ( double *  R,
double  xRotation,
double  yRotation,
double  zRotation 
)

Produce Euler rotation matrix (X,Y,Z). Fill a rotation matrix R such that R = Rx.Ry.Rz. The size of the output matrix R is (4 x 4). R is homogenous: R = {{*, *, *, 0}, {*, *, *, 0}, {*, *, *, 0}, {0, 0, 0, 1}}. The rotation angles are given in the unit of radian.

success: return(!ERROR); failure: return(ERROR)

◆ GetScalingMatrix()

int GetScalingMatrix ( double *  S,
double  xScale,
double  yScale,
double  zScale 
)

Produce scaling matrix. Fill a scaling matrix T. The size of the output matrix T is (4 x 4). T is homogenous: T = {{sx, 0, 0, 0}, {0, sy, 0, 0}, {0, 0, sz, 0}, {0, 0, 0, 1}}

success: return(!ERROR); failure: return(ERROR)

◆ GetTranslationMatrix()

int GetTranslationMatrix ( double *  T,
double  xTranslation,
double  yTranslation,
double  zTranslation 
)

Produce a translation matrix. Fill a translation matrix T. The size of the output matrix T is (4 x 4) T is homogenous: T = {{1, 0, 0, dx}, {0, 1, 0, dy}, {0, 0, 1, dz}, {0, 0, 0, 1}}

success: return(!ERROR); failure: return(ERROR)

◆ LineToLineIntersection()

int LineToLineIntersection ( double  P[],
double  Q[],
double  A[],
double  B[],
double  X[],
long  Lines,
double  Tolerance,
long  MaxIterations,
int *  Intersection,
int *  Status 
)

Do two lines intersect (n-D)?. Compute the intersection of the line (P,Q) with the line (A,B). All vectors have (Lines) elements. I.e., the dimension of the space is (Lines).

return Intersection = FALSE if there is no intersection. return Intersection = TRUE if the intersection is valid.

success: return(!ERROR); failure: return(ERROR)

◆ LineToLineIntersection3D()

int LineToLineIntersection3D ( double  P[],
double  q[],
double  A[],
double  b[],
double  X[],
double  Tolerance,
int *  Intersection 
)

Do two lines intersect (3-D)? Compute the intersection of the line (P,q) with the line (A,b). All points have 3 elements. All vectors have 3 elements.

A line is described by a point and a vector: X = P + t1 * q, X = A + t2 * b where (t1,t2) are free scalars.

The vectors (q, b) must have a normalized unit length.

return Intersection = FALSE if there is no intersection. return Intersection = TRUE if the intersection is valid.

success: return(!ERROR); failure: return(ERROR)

◆ LineToPlaneIntersection()

int LineToPlaneIntersection ( double  P[],
double  Q[],
double  A[],
double  B[],
double  C[],
double  X[],
long  Lines,
double  Tolerance,
long  MaxIterations,
int *  Intersection,
int *  Status 
)

Does a line intersect a plane (n-D)? Compute the intersection of the line (P,Q) with the plane (A,B,C). All vectors have (Lines) elements. I.e., the dimension of the space is (Lines).

return Intersection = FALSE if there is no intersection. return Intersection = TRUE if the intersection is valid.

success: return(!ERROR); failure: return(ERROR)

◆ LineToPlaneIntersection3D()

int LineToPlaneIntersection3D ( double  P[],
double  q[],
double  A[],
double  b[],
double  X[],
double  Tolerance,
int *  Intersection 
)

Does a line intersect a plane (3-D)? Compute the intersection of the line (P,q) with the plane (A,b). All points have 3 elements. All vectors have 3 elements.

A line is described by a point P and a vector q: X = P + t * q, with t a free scalar. A plane is described by a point A and a normal b: <AX, b> = 0. The vectors (q, b) must have a normalized unit length.

return Intersection = FALE if there is no intersection. return Intersection = TRUE if the intersection is valid.

success: return(!ERROR); failure: return(ERROR)

◆ PointsToLine3D()

int PointsToLine3D ( double  P[],
double  Q[],
double  A[],
double  b[],
double  Tolerance 
)

What is the line that passes through two points (3-D)?. Transform the points (P,Q) into the line (A,b). All points have 3 elements. All vectors have 3 elements.

A line is described by a point A and a vector b: X = A + t * b, with t a free scalar. The vector b has a normalized unit length.

success: return(!ERROR); failure: return(ERROR)

◆ PointsToPlane3D()

int PointsToPlane3D ( double  P[],
double  Q[],
double  R[],
double  A[],
double  b[],
double  Tolerance 
)

What is the plane passing through 3 points (3-D)? Transform the points (P,Q,R) into the plane (A,b). All points have 3 elements. All vectors have 3 elements.

A plane is described by a point A and a normal b: <AX, b> = 0. The vectors b has a normalized unit length.

success: return(!ERROR); failure: return(ERROR)

◆ PointToLineMembership()

int PointToLineMembership ( double  P[],
double  A[],
double  B[],
long  Lines,
double  Tolerance,
int *  Membership,
int *  Status 
)

Does a point belong to a line (n-D)?. Test the membership of the point P to the line (A,B). All vectors have (Lines) elements.

return Membership = FALSE if P doesn't belong to (A,B). return Membership = TRUE if P does belong to (A,B).

success: return(!ERROR); failure: return(ERROR)

◆ PointToLineMembership3D()

int PointToLineMembership3D ( double  P[],
double  A[],
double  b[],
double  Tolerance,
int *  Membership 
)

Does a point belong to a line (3-D)? Test the membership of the point P to the line (A,b). All points have 3 elements. All vectors have 3 elements.

A line is described by a point A and a vector b: X = A + t * b, with t a free scalar. The vector b must have a normalized unit length.

return Membership = FALSE if P doesn't belong to (A,b). return Membership = TRUE if P does belong to (A,b).

success: return(!ERROR); failure: return(ERROR)

◆ PointToPlaneMembership()

int PointToPlaneMembership ( double  P[],
double  A[],
double  B[],
double  C[],
long  Lines,
double  Tolerance,
long  MaxIterations,
int *  Membership,
int *  Status 
)

Does a point belong to a plane (n-D)?. Test the membership of the point P to the plane (A,B,C). All vectors have (Lines) elements.

return Membership = FALSE if P doesn't belong to (A,B,C). return Membership = TRUE if P does belong to (A,B,C)

success: return(!ERROR); failure: return(ERROR)

◆ PointToPlaneMembership3D()

int PointToPlaneMembership3D ( double  P[],
double  A[],
double  b[],
double  Tolerance,
int *  Membership 
)

Does a point belong to a plane (3-D)? Test the membership of the point P to the plane (A,b). All points have 3 elements. All vectors have 3 elements.

A plane is described by a point A and a normal b: <AX, b> = 0. The vectors b must have a normalized unit length.

return Membership = FALSE if P doesn't belong to (A,b). return Membership = TRUE if P does belong to (A,b)

success: return(!ERROR); failure: return(ERROR)

◆ ProjectPointToLine()

int ProjectPointToLine ( double  P[],
double  A[],
double  B[],
double  X[],
long  Lines,
double  Tolerance 
)

Project a point onto a line (n-D). Project the point P onto the line (A,B). All vectors have (Lines) elements.

success: return(!ERROR); failure: return(ERROR)

◆ ProjectPointToLine3D()

int ProjectPointToLine3D ( double  P[],
double  A[],
double  b[],
double  X[],
double  Tolerance 
)

Project a point onto a line (3-D). Project the point P onto the line (A,b). All points have 3 elements. All vectors have 3 elements.

A line is described by a point A and a vector b: X = A + t * b, with t a free scalar. The vector b must have a normalized unit length.

success: return(!ERROR); failure: return(ERROR)

◆ ProjectPointToPlane()

int ProjectPointToPlane ( double  P[],
double  A[],
double  B[],
double  C[],
double  X[],
long  Lines,
double  Tolerance,
long  MaxIterations,
int *  Status 
)

Project a point onto a plane (n-D). Project the point P onto the plane (A,B,C). All vectors have (Lines) elements.

success: return(!ERROR); failure: return(ERROR)

◆ ProjectPointToPlane3D()

int ProjectPointToPlane3D ( double  P[],
double  A[],
double  b[],
double  X[],
double  Tolerance 
)

Project a point onto a plane (3-D). Project the point P onto the plane (A,b). All points have 3 elements. All vectors have 3 elements.

A plane is described by a point A and a normal b: <AX, b> = 0. The vectors b must have a normalized unit length.

success: return(!ERROR); failure: return(ERROR)

◆ TestColinearVector()

int TestColinearVector ( double  U[],
double  V[],
long  Lines,
double  Tolerance,
int *  Colinear 
)

Are two vectors colinear (n-D)?. Determine whether the vectors U and V are colinear. The vectors U and V have (Lines) elements.

return Colinear = -1 if at least one of the vectors is degenerate. return Colinear = 0 if the vectors are not colinear. return Colinear = 1 if the vectors are colinear.

success: return(!ERROR); failure: return(ERROR)

◆ TestCoplanarVector()

int TestCoplanarVector ( double  U[],
double  V[],
double  W[],
long  Lines,
double  Tolerance,
long  MaxIterations,
int *  Coplanar,
int *  Status 
)

Are three vectors coplanar (n-D)? Determine whether the vectors (U,V,W) are coplanar. The vectors (U,V,W) have (Lines) elements.

return Coplanar = -1 in degenerate cases. return Coplanar = 0 if the vectors are not coplanar. return Coplanar = 1 if the vectors are coplanar.

success: return(!ERROR); failure: return(ERROR)