Class Vector3D
java.lang.Object
org.openstreetmap.josm.gui.util.imagery.Vector3D
A basic 3D vector class (immutable)
- Since:
- 18246
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThis determines how arguments are used inVector3D(VectorType, double, double, double). -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleThe azimuthal angle phiprivate doubleCosine of azimuthal angle (angle from X axis)private doubleSine of azimuthal angle (angle from X axis)static final Vector3DA non-null default vectorprivate doubleThe polar angle theta (inclination)private doubleCosine of polar angle (angle from Z axis, AKA straight up)private doubleSine of polar angle (angle from Z axis, AKA straight up)private doubleThe radius rprivate final doubleprivate final doubleprivate final double -
Constructor Summary
ConstructorsConstructorDescriptionVector3D(double x, double y, double z) Create a new Vector3D object using the XYZ coordinate systemVector3D(Vector3D.VectorType vectorType, double first, double second, double third) Create a new Vector3D object. -
Method Summary
Modifier and TypeMethodDescriptionbooleandoubleGet the azimuthal angledoubleGet the azimuthal angle cosinedoubleGet the azimuthal angle sinedoubleGet the polar angle (inclination)doubleGet the polar angle cosine (inclination)doubleGet the polar angle sine (inclination)doubleGet the radiusdoublegetX()Get the x coordinatedoublegetY()Get the y coordinatedoublegetZ()Get the z coordinateinthashCode()Normalize the vectortoString()
-
Field Details
-
DEFAULT_VECTOR_3D
A non-null default vector -
x
-
y
-
z
-
radialDistance
The radius r -
polarAngle
The polar angle theta (inclination) -
polarAngleCos
Cosine of polar angle (angle from Z axis, AKA straight up) -
polarAngleSin
Sine of polar angle (angle from Z axis, AKA straight up) -
azimuthalAngle
The azimuthal angle phi -
azimuthalAngleCos
Cosine of azimuthal angle (angle from X axis) -
azimuthalAngleSin
Sine of azimuthal angle (angle from X axis)
-
-
Constructor Details
-
Vector3D
Create a new Vector3D object using the XYZ coordinate system- Parameters:
x- The x coordinatey- The y coordinatez- The z coordinate
-
Vector3D
Create a new Vector3D object. See ordering inVector3D.VectorType.- Parameters:
first- The first coordinatesecond- The second coordinatethird- The third coordinatevectorType- The coordinate type (determines how the other variables are treated)
-
-
Method Details
-
getX
Get the x coordinate- Returns:
- The x coordinate
-
getY
Get the y coordinate- Returns:
- The y coordinate
-
getZ
Get the z coordinate- Returns:
- The z coordinate
-
getRadialDistance
Get the radius- Returns:
- The radius
-
getPolarAngle
Get the polar angle (inclination)- Returns:
- The polar angle
-
getPolarAngleCos
Get the polar angle cosine (inclination)- Returns:
- The polar angle cosine
-
getPolarAngleSin
Get the polar angle sine (inclination)- Returns:
- The polar angle sine
-
getAzimuthalAngle
Get the azimuthal angle- Returns:
- The azimuthal angle
-
getAzimuthalAngleCos
Get the azimuthal angle cosine- Returns:
- The azimuthal angle cosine
-
getAzimuthalAngleSin
Get the azimuthal angle sine- Returns:
- The azimuthal angle sine
-
normalize
Normalize the vector- Returns:
- A normalized vector
-
hashCode
-
equals
-
toString
-