Class Vect3D

java.lang.Object
cds.healpix.common.sphgeom.Vect3D

public final class Vect3D extends Object
Three dimensional vector.
Author:
F.-X. Pineau
  • Constructor Summary

    Constructors
    Constructor
    Description
    Vect3D(double lonRad, double latRad)
    Constructor from the spherical coordinates on the unit sphere.
    Vect3D(double x, double y, double z)
    Constructor for the Cartesian coordiantes.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    static Vect3D
    Returns the cross product of v1 by v2.
    double
    Returns the norm of this vector.
    final Vect3D
    Returns the vector having the same direction than this vector, but normalized (norm = 1).
    Returns a vector having the opposite coordinates of this vector.
    static double
    Returns the scalar product of v1 by v2.
    double
    Returns the latitude coordinates from the vector, in radians.
    double
    Returns the longitude coordinate from the vector, in radians.
    final String
     
    final double
    x()
    Getter
    final double
    y()
    Getter
    final double
    z()
    Getter

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Vect3D

      public Vect3D(double x, double y, double z)
      Constructor for the Cartesian coordiantes.
      Parameters:
      x - first Cartesian coordinate
      y - second Cartesian coordinate
      z - thrid Cartesian coordinate
    • Vect3D

      public Vect3D(double lonRad, double latRad)
      Constructor from the spherical coordinates on the unit sphere.
      Parameters:
      lonRad - longitude, in radians
      latRad - 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

      public Vect3D 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

      public Vect3D 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

      public final Vect3D 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

      public static double scalarProd(Vect3D v1, Vect3D v2)
      Returns the scalar product of v1 by v2.
      Parameters:
      v1 - vector 1
      v2 - vector 2
      Returns:
      the scalar product of v1 by v2.
    • crossProd

      public static Vect3D crossProd(Vect3D v1, Vect3D v2)
      Returns the cross product of v1 by v2.
      Parameters:
      v1 - vector 1
      v2 - vector 2
      Returns:
      the cross product of v1 by v2.
    • toString

      public final String toString()
      Overrides:
      toString in class Object