hep.physics.vec
Class BasicHep3Vector

java.lang.Object
  extended by hep.physics.vec.BasicHep3Vector
All Implemented Interfaces:
Hep3Vector, java.io.Serializable

public class BasicHep3Vector
extends java.lang.Object
implements Hep3Vector, java.io.Serializable

Basic implementation of a Hep3Vector

Version:
$Id: BasicHep3Vector.java 9146 2006-10-16 19:22:42Z tonyj $
Author:
Gary Bower (grb@slac.stanford.edu)
See Also:
Serialized Form

Constructor Summary
BasicHep3Vector()
           
BasicHep3Vector(double[] d)
          Create a BasicHep3Vector from a double array
BasicHep3Vector(double dx, double dy, double dz)
           
BasicHep3Vector(float[] f)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 double magnitude()
          The length of the 3-vector.
 double magnitudeSquared()
          The square of the length
 void setV(double dx, double dy, double dz)
           
 java.lang.String toString()
           
 double[] v()
           
 double x()
           
 double y()
           
 double z()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicHep3Vector

public BasicHep3Vector()

BasicHep3Vector

public BasicHep3Vector(double dx,
                       double dy,
                       double dz)

BasicHep3Vector

public BasicHep3Vector(double[] d)
Create a BasicHep3Vector from a double array

Parameters:
d - An array {x,y,z}

BasicHep3Vector

public BasicHep3Vector(float[] f)
Method Detail

setV

public void setV(double dx,
                 double dy,
                 double dz)

x

public double x()
Specified by:
x in interface Hep3Vector

y

public double y()
Specified by:
y in interface Hep3Vector

z

public double z()
Specified by:
z in interface Hep3Vector

magnitude

public double magnitude()
Description copied from interface: Hep3Vector
The length of the 3-vector.

Specified by:
magnitude in interface Hep3Vector

magnitudeSquared

public double magnitudeSquared()
Description copied from interface: Hep3Vector
The square of the length

Specified by:
magnitudeSquared in interface Hep3Vector

v

public double[] v()
Specified by:
v in interface Hep3Vector

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2000-2010 FreeHEP. All Rights Reserved.