gov.nasa.worldwind.geom
Class Matrix
java.lang.Object
gov.nasa.worldwind.geom.Matrix
public class Matrix
- extends Object
Constructor Summary |
Matrix(double value)
|
Matrix(double m11,
double m12,
double m13,
double m14,
double m21,
double m22,
double m23,
double m24,
double m31,
double m32,
double m33,
double m34,
double m41,
double m42,
double m43,
double m44)
|
Method Summary |
Matrix |
add(Matrix matrix)
|
Matrix |
divideComponents(double value)
|
Matrix |
divideComponents(Matrix matrix)
|
boolean |
equals(Object obj)
|
static Matrix |
fromArray(double[] compArray,
int offset,
boolean rowMajor)
|
static Matrix |
fromAxisAngle(Angle angle,
double axisX,
double axisY,
double axisZ)
|
static Matrix |
fromAxisAngle(Angle angle,
Vec4 axis)
|
static Matrix |
fromGeographicToImage(AVList worldFileParams)
|
static Matrix |
fromGeographicToImage(Point2D[] imagePoints,
LatLon[] geoPoints)
|
static Matrix |
fromGeographicToViewport(Sector sector,
int x,
int y,
int width,
int height)
Computes a Matrix that will map the geographic region defined by sector onto a Cartesian region of the specified
width and height and centered at the point (x, y) . |
static Matrix |
fromImageToGeographic(AVList worldFileParams)
|
static Matrix |
fromImageToGeographic(int imageWidth,
int imageHeight,
Sector sector)
Computes a Matrix that will map a aligned 2D grid coordinates to geographic coordinates in degrees. |
static Matrix |
fromImageToGeographic(Point2D[] imagePoints,
LatLon[] geoPoints)
Computes a Matrix that will map constrained 2D grid coordinates to geographic coordinates in
degrees. |
static Matrix |
fromModelLookAt(Vec4 eye,
Vec4 center,
Vec4 up)
|
static Matrix |
fromOrthographic(double width,
double height,
double near,
double far)
|
static Matrix |
fromOrthographic2D(double width,
double height)
|
static Matrix |
fromPerspective(Angle horizontalFieldOfView,
double viewportWidth,
double viewportHeight,
double near,
double far)
|
static Matrix |
fromPerspective(double width,
double height,
double near,
double far)
|
static Matrix |
fromQuaternion(Quaternion quaternion)
|
static Matrix |
fromRotationX(Angle angle)
|
static Matrix |
fromRotationXYZ(Angle xRotation,
Angle yRotation,
Angle zRotation)
|
static Matrix |
fromRotationY(Angle angle)
|
static Matrix |
fromRotationZ(Angle angle)
|
static Matrix |
fromScale(double scale)
|
static Matrix |
fromScale(double scaleX,
double scaleY,
double scaleZ)
|
static Matrix |
fromScale(Vec4 scale)
|
static Matrix |
fromTranslation(double x,
double y,
double z)
|
static Matrix |
fromTranslation(Vec4 translation)
|
static Matrix |
fromViewLookAt(Vec4 eye,
Vec4 center,
Vec4 up)
|
double |
getDeterminant()
|
Matrix |
getInverse()
|
double |
getM11()
|
double |
getM12()
|
double |
getM13()
|
double |
getM14()
|
double |
getM21()
|
double |
getM22()
|
double |
getM23()
|
double |
getM24()
|
double |
getM31()
|
double |
getM32()
|
double |
getM33()
|
double |
getM34()
|
double |
getM41()
|
double |
getM42()
|
double |
getM43()
|
double |
getM44()
|
Angle |
getRotationX()
|
Angle |
getRotationY()
|
Angle |
getRotationZ()
|
double |
getTrace()
|
Vec4 |
getTranslation()
|
Matrix |
getTranspose()
|
int |
hashCode()
|
double |
m11()
|
double |
m12()
|
double |
m13()
|
double |
m14()
|
double |
m21()
|
double |
m22()
|
double |
m23()
|
double |
m24()
|
double |
m31()
|
double |
m32()
|
double |
m33()
|
double |
m34()
|
double |
m41()
|
double |
m42()
|
double |
m43()
|
double |
m44()
|
Matrix |
multiply(Matrix matrix)
|
Matrix |
multiplyComponents(double value)
|
Matrix |
negate()
|
Matrix |
subtract(Matrix matrix)
|
double[] |
toArray(double[] compArray,
int offset,
boolean rowMajor)
|
String |
toString()
|
IDENTITY
public static final Matrix IDENTITY
m11
public final double m11
m12
public final double m12
m13
public final double m13
m14
public final double m14
m21
public final double m21
m22
public final double m22
m23
public final double m23
m24
public final double m24
m31
public final double m31
m32
public final double m32
m33
public final double m33
m34
public final double m34
m41
public final double m41
m42
public final double m42
m43
public final double m43
m44
public final double m44
Matrix
public Matrix(double value)
Matrix
public Matrix(double m11,
double m12,
double m13,
double m14,
double m21,
double m22,
double m23,
double m24,
double m31,
double m32,
double m33,
double m34,
double m41,
double m42,
double m43,
double m44)
add
public final Matrix add(Matrix matrix)
divideComponents
public final Matrix divideComponents(double value)
divideComponents
public final Matrix divideComponents(Matrix matrix)
equals
public final boolean equals(Object obj)
- Overrides:
equals
in class Object
fromArray
public static Matrix fromArray(double[] compArray,
int offset,
boolean rowMajor)
fromAxisAngle
public static Matrix fromAxisAngle(Angle angle,
double axisX,
double axisY,
double axisZ)
fromAxisAngle
public static Matrix fromAxisAngle(Angle angle,
Vec4 axis)
fromGeographicToImage
public static Matrix fromGeographicToImage(AVList worldFileParams)
fromGeographicToImage
public static Matrix fromGeographicToImage(Point2D[] imagePoints,
LatLon[] geoPoints)
fromGeographicToViewport
public static Matrix fromGeographicToViewport(Sector sector,
int x,
int y,
int width,
int height)
- Computes a Matrix that will map the geographic region defined by sector onto a Cartesian region of the specified
width
and height
and centered at the point (x, y)
.
- Parameters:
sector
- the geographic region which will be mapped to the Cartesian regionx
- x-coordinate of lower left hand corner of the Cartesian regiony
- y-coordinate of lower left hand corner of the Cartesian regionwidth
- width of the Cartesian region, extending to the right from the x-coordinateheight
- height of the Cartesian region, extending up from the y-coordinate
- Returns:
- Matrix that will map from the geographic region to the Cartesian region.
- Throws:
IllegalArgumentException
- if sector
is null, or if width
or height
are less than zero.
fromImageToGeographic
public static Matrix fromImageToGeographic(AVList worldFileParams)
fromImageToGeographic
public static Matrix fromImageToGeographic(int imageWidth,
int imageHeight,
Sector sector)
- Computes a
Matrix
that will map a aligned 2D grid coordinates to geographic coordinates in degrees.
It is assumed that the destination grid is parallel with lines of latitude and longitude, and has its origin
in the upper left hand corner.
- Parameters:
sector
- the grid sector.imageWidth
- the grid width.imageHeight
- the grid height.
- Returns:
Matrix
that will map from grid coordinates to geographic coordinates in degrees.
- Throws:
IllegalArgumentException
- if sector
is null, or if either width
or
height
are less than 1.
fromImageToGeographic
public static Matrix fromImageToGeographic(Point2D[] imagePoints,
LatLon[] geoPoints)
- Computes a
Matrix
that will map constrained 2D grid coordinates to geographic coordinates in
degrees. The grid is defined by three control points. Each control point maps a location in the source grid to a
geographic location.
- Parameters:
imagePoints
- three control points in the source grid.geoPoints
- three geographic locations corresponding to each grid control point.
- Returns:
Matrix
that will map from geographic coordinates to grid coordinates in degrees.
- Throws:
IllegalArgumentException
- if either imagePoints
or geoPoints
is null or
have length less than 3.
fromModelLookAt
public static Matrix fromModelLookAt(Vec4 eye,
Vec4 center,
Vec4 up)
fromOrthographic
public static Matrix fromOrthographic(double width,
double height,
double near,
double far)
fromOrthographic2D
public static Matrix fromOrthographic2D(double width,
double height)
fromPerspective
public static Matrix fromPerspective(Angle horizontalFieldOfView,
double viewportWidth,
double viewportHeight,
double near,
double far)
fromPerspective
public static Matrix fromPerspective(double width,
double height,
double near,
double far)
fromQuaternion
public static Matrix fromQuaternion(Quaternion quaternion)
fromRotationX
public static Matrix fromRotationX(Angle angle)
fromRotationXYZ
public static Matrix fromRotationXYZ(Angle xRotation,
Angle yRotation,
Angle zRotation)
fromRotationY
public static Matrix fromRotationY(Angle angle)
fromRotationZ
public static Matrix fromRotationZ(Angle angle)
fromScale
public static Matrix fromScale(double scale)
fromScale
public static Matrix fromScale(double scaleX,
double scaleY,
double scaleZ)
fromScale
public static Matrix fromScale(Vec4 scale)
fromTranslation
public static Matrix fromTranslation(double x,
double y,
double z)
fromTranslation
public static Matrix fromTranslation(Vec4 translation)
fromViewLookAt
public static Matrix fromViewLookAt(Vec4 eye,
Vec4 center,
Vec4 up)
getDeterminant
public final double getDeterminant()
getInverse
public final Matrix getInverse()
getM11
public final double getM11()
getM12
public final double getM12()
getM13
public final double getM13()
getM14
public final double getM14()
getM21
public final double getM21()
getM22
public final double getM22()
getM23
public final double getM23()
getM24
public final double getM24()
getM31
public final double getM31()
getM32
public final double getM32()
getM33
public final double getM33()
getM34
public final double getM34()
getM41
public final double getM41()
getM42
public final double getM42()
getM43
public final double getM43()
getM44
public final double getM44()
getRotationX
public final Angle getRotationX()
getRotationY
public final Angle getRotationY()
getRotationZ
public final Angle getRotationZ()
getTrace
public final double getTrace()
getTranslation
public final Vec4 getTranslation()
getTranspose
public final Matrix getTranspose()
hashCode
public final int hashCode()
- Overrides:
hashCode
in class Object
m11
public final double m11()
m12
public final double m12()
m13
public final double m13()
m14
public final double m14()
m21
public final double m21()
m22
public final double m22()
m23
public final double m23()
m24
public final double m24()
m31
public final double m31()
m32
public final double m32()
m33
public final double m33()
m34
public final double m34()
m41
public final double m41()
m42
public final double m42()
m43
public final double m43()
m44
public final double m44()
multiply
public final Matrix multiply(Matrix matrix)
multiplyComponents
public final Matrix multiplyComponents(double value)
negate
public final Matrix negate()
subtract
public final Matrix subtract(Matrix matrix)
toArray
public final double[] toArray(double[] compArray,
int offset,
boolean rowMajor)
toString
public final String toString()
- Overrides:
toString
in class Object