Class GeometryMath_F64
- java.lang.Object
-
- georegression.geometry.GeometryMath_F64
-
public class GeometryMath_F64 extends java.lang.ObjectMath operations that can be applied to geometric primitives.
-
-
Constructor Summary
Constructors Constructor and Description GeometryMath_F64()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidadd(double a0, GeoTuple3D_F64 pt0, double a1, GeoTuple3D_F64 pt1, GeoTuple3D_F64 pt2)Adds two points together while scaling them.
pt2 = a0 pt0 + a1 pt1static voidadd(GeoTuple3D_F64 a, GeoTuple3D_F64 b, GeoTuple3D_F64 c)Adds two points together.
c = a + bstatic <T extends GeoTuple3D_F64>
TaddMult(T p0, org.ejml.data.DenseMatrix64F M, T p1, T ret)ret = p0 + M*p1static org.ejml.data.DenseMatrix64FaddOuterProd(org.ejml.data.DenseMatrix64F A, double scalar, GeoTuple3D_F64 b, GeoTuple3D_F64 c, org.ejml.data.DenseMatrix64F ret)Adds the outer product of two vectors onto a matrix:
ret = A + scalar*a*bTstatic voidchangeSign(GeoTuple3D_F64 t)Changes the sign of the vector:
T = -Tstatic voidcross(double a_x, double a_y, double a_z, double b_x, double b_y, double b_z, GeoTuple3D_F64 c)Computes the cross product:
c = a x bstatic voidcross(GeoTuple2D_F64 a, GeoTuple2D_F64 b, GeoTuple3D_F64 c)Computes the cross product:
c = a x bstatic voidcross(GeoTuple2D_F64 a, GeoTuple3D_F64 b, GeoTuple3D_F64 c)Computes the cross product:
c = a x b
where 'a' is in homogeneous coordinates.static voidcross(GeoTuple3D_F64 a, GeoTuple3D_F64 b, GeoTuple3D_F64 c)Computes the cross product:
c = a x bstatic org.ejml.data.DenseMatrix64FcrossMatrix(double x0, double x1, double x2, org.ejml.data.DenseMatrix64F ret)Creates a skew symmetric cross product matrix from the provided tuple.static org.ejml.data.DenseMatrix64FcrossMatrix(GeoTuple3D_F64 v, org.ejml.data.DenseMatrix64F ret)Creates a skew symmetric cross product matrix from the provided tuple.static doubledot(GeoTuple3D_F64 a, GeoTuple3D_F64 b)Dot product: ret = aTbstatic doubleinnerProd(GeoTuple2D_F64 a, org.ejml.data.DenseMatrix64F M, GeoTuple2D_F64 b)Computes the inner matrix product: ret = a'*M*b
where ret is a scalar number.static doubleinnerProd(GeoTuple3D_F64 a, org.ejml.data.DenseMatrix64F M, GeoTuple3D_F64 b)ret = aT*M*bstatic doubleinnerProdTranM(GeoTuple3D_F64 a, org.ejml.data.DenseMatrix64F M, GeoTuple3D_F64 b)Computes the inner matrix product:
ret = xTATystatic voidmult(org.ejml.data.DenseMatrix64F M, GeoTuple2D_F64 pt, GeoTuple3D_F64 mod)mod = M*pt
where pt has z=1 implicitly.static <T extends GeoTuple2D_F64>
Tmult(org.ejml.data.DenseMatrix64F M, GeoTuple3D_F64 pt, T mod)mod = M*pt
where mod is a 2D point that has an implicit z=1.static <T extends GeoTuple2D_F64>
Tmult(org.ejml.data.DenseMatrix64F M, T pt, T mod)Computes mod = M*pt, where both pt and mod are in homogeneous coordinates with z assumed to be equal to 1, and M is a 3x3 matrix.static <T extends GeoTuple3D_F64>
Tmult(org.ejml.data.DenseMatrix64F M, T pt, T result)mod = M*ptstatic org.ejml.data.DenseMatrix64FmultCrossA(GeoTuple2D_F64 A, org.ejml.data.DenseMatrix64F M, org.ejml.data.DenseMatrix64F result)Computes the following:
result = cross(A)*M
where M and result are 3x3 matrices, cross(A) is the cross product matrix of A.static org.ejml.data.DenseMatrix64FmultCrossA(GeoTuple3D_F64 A, org.ejml.data.DenseMatrix64F M, org.ejml.data.DenseMatrix64F result)Computes the following:
result = cross(A)*M
where M and result are 3x3 matrices, cross(A) is the cross product matrix of A.static <T extends GeoTuple2D_F64>
TmultTran(org.ejml.data.DenseMatrix64F M, GeoTuple2D_F64 pt, T mod)mod = MT*pt
where pt.z = 1 implicitly.static <T extends GeoTuple3D_F64>
TmultTran(org.ejml.data.DenseMatrix64F M, GeoTuple2D_F64 pt, T mod)mod = MT*pt
where pt.z = 1 implicitly.static <T extends GeoTuple3D_F64>
TmultTran(org.ejml.data.DenseMatrix64F M, T pt, T mod)mod = MT*pt.static org.ejml.data.DenseMatrix64FouterProd(GeoTuple3D_F64 a, GeoTuple3D_F64 b, org.ejml.data.DenseMatrix64F ret)Computes the outer product of two vectors:
O = a*bTstatic voidrotate(double c, double s, GeoTuple2D_F64 pt, GeoTuple2D_F64 solution)Rotates a 2D point by the specified angle.static voidrotate(double theta, GeoTuple2D_F64 pt, GeoTuple2D_F64 solution)Rotates a 2D point by the specified angle.static voidscale(GeoTuple3D_F64 p, double v)Multiplies each element in the tuple by 'v'.
pi=pi*vstatic voidsub(GeoTuple3D_F64 a, GeoTuple3D_F64 b, GeoTuple3D_F64 c)Substracts two points from each other.
c = a - bstatic org.ejml.data.DenseMatrix64FtoMatrix(GeoTuple3D_F64 in, org.ejml.data.DenseMatrix64F out)Converts a GeoTuple3D_F64 into DenseMatrix64Fstatic voidtoTuple3D(org.ejml.data.DenseMatrix64F in, GeoTuple3D_F64 out)Converts a DenseMatrix64F into GeoTuple3D_F64
-
-
-
Method Detail
-
crossMatrix
public static org.ejml.data.DenseMatrix64F crossMatrix(double x0, double x1, double x2, org.ejml.data.DenseMatrix64F ret)Creates a skew symmetric cross product matrix from the provided tuple.- Parameters:
x0- Element 0.x1- Element 1.x2- Element 2.ret- If not null the results are stored here, otherwise a new matrix is created.- Returns:
- Skew symmetric cross product matrix.
-
crossMatrix
public static org.ejml.data.DenseMatrix64F crossMatrix(GeoTuple3D_F64 v, org.ejml.data.DenseMatrix64F ret)
Creates a skew symmetric cross product matrix from the provided tuple.- Parameters:
v- Tuple. Not modified.ret- If not null the results are stored here, otherwise a new matrix is created.- Returns:
- Skew symmetric cross product matrix.
-
cross
public static void cross(GeoTuple3D_F64 a, GeoTuple3D_F64 b, GeoTuple3D_F64 c)
Computes the cross product:
c = a x b- Parameters:
a- Not modified.b- Not modified.c- Modified.
-
cross
public static void cross(double a_x, double a_y, double a_z, double b_x, double b_y, double b_z, GeoTuple3D_F64 c)Computes the cross product:
c = a x b- Parameters:
a_x- x-coordinate of aa_y- y-coordinate of aa_z- z-coordinate of ab_x- x-coordinate of bb_y- y-coordinate of bb_z- z-coordinate of bc- Modified.
-
cross
public static void cross(GeoTuple2D_F64 a, GeoTuple3D_F64 b, GeoTuple3D_F64 c)
Computes the cross product:
c = a x b
where 'a' is in homogeneous coordinates.- Parameters:
a- Homogeneous coordinates, z = 1 assumed. Not modified.b- Not modified.c- Modified.
-
cross
public static void cross(GeoTuple2D_F64 a, GeoTuple2D_F64 b, GeoTuple3D_F64 c)
Computes the cross product:
c = a x b- Parameters:
a- Homogeneous coordinates, z = 1 assumed. Not modified.b- Homogeneous coordinates, z = 1 assumed. Not modified.c- Modified.
-
add
public static void add(GeoTuple3D_F64 a, GeoTuple3D_F64 b, GeoTuple3D_F64 c)
Adds two points together.
c = a + bPoint 'c' can be the same instance as 'a' or 'b'.
- Parameters:
a- A point. Not modified.b- A point. Not modified.c- Where the results are stored. Modified.
-
add
public static void add(double a0, GeoTuple3D_F64 pt0, double a1, GeoTuple3D_F64 pt1, GeoTuple3D_F64 pt2)Adds two points together while scaling them.
pt2 = a0 pt0 + a1 pt1Point 'c' can be the same instance as 'a' or 'b'.
- Parameters:
a0- Scaling factor for pt0.pt0- A point. Not modified.a1- Scaling factor for pt1.pt1- A point. Not modified.pt2- Where the results are stored. Modified.
-
addMult
public static <T extends GeoTuple3D_F64> T addMult(T p0, org.ejml.data.DenseMatrix64F M, T p1, T ret)
ret = p0 + M*p1- Parameters:
p0-M-p1-ret-
-
sub
public static void sub(GeoTuple3D_F64 a, GeoTuple3D_F64 b, GeoTuple3D_F64 c)
Substracts two points from each other.
c = a - bPoint 'c' can be the same instance as 'a' or 'b'.
- Parameters:
a- A point. Not modified.b- A point. Not modified.c- Where the results are stored. Modified.
-
rotate
public static void rotate(double theta, GeoTuple2D_F64 pt, GeoTuple2D_F64 solution)Rotates a 2D point by the specified angle.- Parameters:
theta-pt-solution- where the solution is written to. Can be the same point as 'pt'.
-
rotate
public static void rotate(double c, double s, GeoTuple2D_F64 pt, GeoTuple2D_F64 solution)Rotates a 2D point by the specified angle.- Parameters:
c- Cosine of thetas- Sine of thetapt-solution- where the solution is written to. Can be the same point as 'pt'.
-
mult
public static <T extends GeoTuple3D_F64> T mult(org.ejml.data.DenseMatrix64F M, T pt, T result)
mod = M*ptpt and mod can be the same reference.
- Parameters:
M-pt-result- Storage for output. Can be the same instance as param 'pt'. Modified.
-
mult
public static <T extends GeoTuple2D_F64> T mult(org.ejml.data.DenseMatrix64F M, GeoTuple3D_F64 pt, T mod)
mod = M*pt
where mod is a 2D point that has an implicit z=1.Multiplies the 3x3 matrix against the 3D point, and normalizes the 2D point output by dividing the x and y values by the found z.
-
mult
public static void mult(org.ejml.data.DenseMatrix64F M, GeoTuple2D_F64 pt, GeoTuple3D_F64 mod)mod = M*pt
where pt has z=1 implicitly.Multiplies the 3x3 matrix against the 2D point, which has an implicit z=1 value, and the output is a 3d point.
-
mult
public static <T extends GeoTuple2D_F64> T mult(org.ejml.data.DenseMatrix64F M, T pt, T mod)
Computes mod = M*pt, where both pt and mod are in homogeneous coordinates with z assumed to be equal to 1, and M is a 3x3 matrix.
'pt' and 'mod' can be the same point.
- Parameters:
M- 3x3 matrixpt- Homogeneous point with z=1mod- Storage for the computation. If null a new point is declared. Can be same instance as pt.- Returns:
- Result of computation.
-
multCrossA
public static org.ejml.data.DenseMatrix64F multCrossA(GeoTuple2D_F64 A, org.ejml.data.DenseMatrix64F M, org.ejml.data.DenseMatrix64F result)
Computes the following:
result = cross(A)*M
where M and result are 3x3 matrices, cross(A) is the cross product matrix of A.- Parameters:
A- 2D homogenous coordinate (implicit z = 1) that is internally converted into cross product matrix.M- 3x3 matrix.result- Storage for results. Can be null.- Returns:
- Results.
-
multCrossA
public static org.ejml.data.DenseMatrix64F multCrossA(GeoTuple3D_F64 A, org.ejml.data.DenseMatrix64F M, org.ejml.data.DenseMatrix64F result)
Computes the following:
result = cross(A)*M
where M and result are 3x3 matrices, cross(A) is the cross product matrix of A.- Parameters:
A- 3D coordinate that is internally converted into cross product matrix.M- 3x3 matrix.result- Storage for results. Can be null.- Returns:
- Results.
-
multTran
public static <T extends GeoTuple3D_F64> T multTran(org.ejml.data.DenseMatrix64F M, T pt, T mod)
mod = MT*pt. Both pt and mod can be the same instance.
-
multTran
public static <T extends GeoTuple3D_F64> T multTran(org.ejml.data.DenseMatrix64F M, GeoTuple2D_F64 pt, T mod)
mod = MT*pt
where pt.z = 1 implicitly.- Parameters:
M- 3 by 3 matrix.pt- 2D point in homogeneous coordinates. Implicit z = 1mod- 2D point in homogeneous coordinates. Implicit z = 1- Returns:
- 2D point in homogeneous coordinates. Implicit z = 1
-
multTran
public static <T extends GeoTuple2D_F64> T multTran(org.ejml.data.DenseMatrix64F M, GeoTuple2D_F64 pt, T mod)
mod = MT*pt
where pt.z = 1 implicitly.- Parameters:
M- 3 by 3 matrix.pt- 2D point in homogeneous coordinates. Implicit z = 1mod- 2D point in homogeneous coordinates. Implicit z = 1- Returns:
- 2D point in homogeneous coordinates. Implicit z = 1
-
innerProd
public static double innerProd(GeoTuple3D_F64 a, org.ejml.data.DenseMatrix64F M, GeoTuple3D_F64 b)
ret = aT*M*b
- Parameters:
a- 3D point.M- 3 by 3 matrix.b- 3D point.- Returns:
- scalar number
-
innerProdTranM
public static double innerProdTranM(GeoTuple3D_F64 a, org.ejml.data.DenseMatrix64F M, GeoTuple3D_F64 b)
Computes the inner matrix product:
ret = xTATy- Parameters:
a- 3D point.M- 3 by 3 matrix.b- 3D point.- Returns:
- scalar number
-
outerProd
public static org.ejml.data.DenseMatrix64F outerProd(GeoTuple3D_F64 a, GeoTuple3D_F64 b, org.ejml.data.DenseMatrix64F ret)
Computes the outer product of two vectors:
O = a*bT- Parameters:
a- 3D vectorb- 3D vectorret- 3 x 3 matrix or null.- Returns:
- outer product of two 3d vectors
-
addOuterProd
public static org.ejml.data.DenseMatrix64F addOuterProd(org.ejml.data.DenseMatrix64F A, double scalar, GeoTuple3D_F64 b, GeoTuple3D_F64 c, org.ejml.data.DenseMatrix64F ret)Adds the outer product of two vectors onto a matrix:
ret = A + scalar*a*bT- Parameters:
A- 3x3 matrixb- 3D vectorc- 3D vectorret- 3 x 3 matrix or null.- Returns:
- outer product of two 3d vectors
-
innerProd
public static double innerProd(GeoTuple2D_F64 a, org.ejml.data.DenseMatrix64F M, GeoTuple2D_F64 b)
Computes the inner matrix product: ret = a'*M*b
where ret is a scalar number. 'a' and 'b' are automatically converted into homogeneous coordinates.- Parameters:
a- 2D point.M- 3 by 3 matrix.b- 2D point.- Returns:
- scalar number,
-
dot
public static double dot(GeoTuple3D_F64 a, GeoTuple3D_F64 b)
Dot product: ret = aTb
- Parameters:
a- A tuple.b- A tuple.- Returns:
- scalar
-
scale
public static void scale(GeoTuple3D_F64 p, double v)
Multiplies each element in the tuple by 'v'.
pi=pi*v- Parameters:
p- tuple.v- scaling factor.
-
changeSign
public static void changeSign(GeoTuple3D_F64 t)
Changes the sign of the vector:
T = -T- Parameters:
t- Vector whose sign is being changed. Modified.
-
toMatrix
public static org.ejml.data.DenseMatrix64F toMatrix(GeoTuple3D_F64 in, org.ejml.data.DenseMatrix64F out)
Converts a GeoTuple3D_F64 into DenseMatrix64F- Parameters:
in- Input vectorout- Output matrix. If null a new matrix will be declared- Returns:
- Converted matrix
-
toTuple3D
public static void toTuple3D(org.ejml.data.DenseMatrix64F in, GeoTuple3D_F64 out)Converts a DenseMatrix64F into GeoTuple3D_F64- Parameters:
in- Input matrixout- Output vector.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG