Package cds.healpix.common.sphgeom
Class Vect3D
java.lang.Object
cds.healpix.common.sphgeom.Vect3D
Three dimensional vector.
- Author:
- F.-X. Pineau
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
static Vect3D
Returns the cross product of v1 by v2.double
norm()
Returns the norm of this vector.final Vect3D
Returns the vector having the same direction than this vector, but normalized (norm = 1).opposite()
Returns a vector having the opposite coordinates of this vector.static double
scalarProd
(Vect3D v1, Vect3D v2) Returns the scalar product of v1 by v2.double
toLat()
Returns the latitude coordinates from the vector, in radians.double
toLon()
Returns the longitude coordinate from the vector, in radians.final String
toString()
final double
x()
Getterfinal double
y()
Getterfinal double
z()
Getter
-
Constructor Details
-
Vect3D
public Vect3D(double x, double y, double z) Constructor for the Cartesian coordiantes.- Parameters:
x
- first Cartesian coordinatey
- second Cartesian coordinatez
- thrid Cartesian coordinate
-
Vect3D
public Vect3D(double lonRad, double latRad) Constructor from the spherical coordinates on the unit sphere.- Parameters:
lonRad
- longitude, in radianslatRad
- latitude, in radians
-
-
Method Details
-
x
public final double x()Getter- Returns:
- the x cartesian coordinate
-
y
public final double y()Getter- Returns:
- the y cartesian coordinate
-
z
public final double z()Getter- Returns:
- the z cartesian coordinate
-
clone
-
toLon
public double toLon()Returns the longitude coordinate from the vector, in radians.- Returns:
- the longitude coordinate from the vector, in radians.
-
toLat
public double toLat()Returns the latitude coordinates from the vector, in radians.- Returns:
- the latitude coordinates from the vector, in radians.
-
opposite
Returns a vector having the opposite coordinates of this vector.- Returns:
- a vector having the opposite coordinates of this vector.
-
norm
public double norm()Returns the norm of this vector.- Returns:
- the norm of this vector.
-
normalized
Returns the vector having the same direction than this vector, but normalized (norm = 1).- Returns:
- the vector having the same direction than this vector, but normalized (norm = 1).
-
scalarProd
Returns the scalar product of v1 by v2.- Parameters:
v1
- vector 1v2
- vector 2- Returns:
- the scalar product of v1 by v2.
-
crossProd
Returns the cross product of v1 by v2.- Parameters:
v1
- vector 1v2
- vector 2- Returns:
- the cross product of v1 by v2.
-
toString
-