Package healpix.essentials
Class Vec3
java.lang.Object
healpix.essentials.Vec3
Cartesian 3-vector.
    Instead of using the javax.vecmath.Vector3d class, this separate class was
    implemented for two reasons: first, to avoid the external dependency from
    vecmath.jar, and also because the function Vector3d.angle(Vector3d v1) is
    too inaccurate for usage in Healpix for very small angles.
- Author:
- Martin Reinecke
- Copyright:
- (C) 2011-2015 Max-Planck-Society
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionVector additionfinal doubleAngle between two vectors.Vector cross product.final doubleComputes the dot product of the this vector andv1.booleanvoidflip()Invert the signs of all componentsflipped()inthashCode()final doublelength()Vector lengthfinal doubleSquared vector lengthmul(double n) Vector scaling.norm()Return normalized vectorvoidNormalize the vectorvoidscale(double n) Scale the vector by a given factorVector subtractiondouble[]toArray()voidtoArray(double[] arr) toString()
- 
Field Details- 
xpublic double x
- 
ypublic double y
- 
zpublic double z
 
- 
- 
Constructor Details
- 
Method Details- 
lengthpublic final double length()Vector length- Returns:
- the length of the vector.
 
- 
lengthSquaredpublic final double lengthSquared()Squared vector length- Returns:
- the squared length of the vector.
 
- 
normalizepublic void normalize()Normalize the vector
- 
normReturn normalized vector
- 
angleAngle between two vectors.- Parameters:
- v1- another vector
- Returns:
- the angle in radians between this vector and v1; constrained to the range [0,PI].
 
- 
crossVector cross product.- Parameters:
- v- another vector
- Returns:
- the vector cross product between this vector and v
 
- 
mulVector scaling.- Parameters:
- n- the scale number to be multiply to the coordinates- x,y,z
- Returns:
- the vector with coordinates multiplied by n
 
- 
flippublic void flip()Invert the signs of all components
- 
flipped
- 
scalepublic void scale(double n) Scale the vector by a given factor- Parameters:
- n- the scale factor
 
- 
dotComputes the dot product of the this vector andv1.- Parameters:
- v1- another vector
- Returns:
- dot product
 
- 
addVector addition- Parameters:
- v- the vector to be added
- Returns:
- addition result
 
- 
subVector subtraction- Parameters:
- v- the vector to be subtracted
- Returns:
- subtraction result
 
- 
toString
- 
toArraypublic double[] toArray()
- 
toArraypublic void toArray(double[] arr) 
- 
equals
- 
hashCodepublic int hashCode()
 
-