hep.physics.vec
Class SpacePoint

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

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

A Hep3Vector representing a point in space. Derived from work by Norman Graf, Jan Strube and Frank Gaede

Version:
$Id: SpacePoint.java 12630 2007-06-10 16:32:10Z tonyj $
See Also:
Serialized Form

Nested Class Summary
static class SpacePoint.Representation
           
 
Constructor Summary
SpacePoint()
          Default constructor.
SpacePoint(Hep3Vector vec)
           
SpacePoint(SpacePoint spt)
          Copy constructor
 
Method Summary
 java.lang.Object clone()
          Clone
 double cosPhi()
          cos(phi)
 double cosTheta()
          cos(theta)
static double distance(SpacePoint spt1, SpacePoint spt2)
          Return the distance between two space points.
 boolean equals(Hep3Vector spt, double precision)
          Tests for equality within errors
 boolean equals(SpacePoint x)
          Tests for equality
 boolean equals(SpacePoint spt, double precision)
          Tests for equality within errors
 double[] getCartesianArray()
           
 SpacePoint.Representation getRepresentation()
           
 double magnitude()
          The length of the 3-vector.
 double magnitudeSquared()
          The square of the length
 boolean notEquals(SpacePoint spt)
          Inequality
 double phi()
          Cylindrical phi
 double rxy()
          Cylindrical r
 double rxyz()
          Spherical r
 double sinPhi()
          sin(phi)
 double sinTheta()
          sin(theta)
 double theta()
          Spherical theta
 java.lang.String toString()
          Output Stream
 double[] v()
          Returns the space point as a double array in its internal representation
 double x()
          Cartesian x
 double y()
          Cartesian y
 double z()
          Cartesian z
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpacePoint

public SpacePoint()
Default constructor. Sets point to be the origin (0,0,0)


SpacePoint

public SpacePoint(SpacePoint spt)
Copy constructor

Parameters:
spt - SpacePoint to copy

SpacePoint

public SpacePoint(Hep3Vector vec)
Method Detail

v

public double[] v()
Returns the space point as a double array in its internal representation

Specified by:
v in interface Hep3Vector
See Also:
getRepresentation()

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

x

public double x()
Cartesian x

Specified by:
x in interface Hep3Vector

y

public double y()
Cartesian y

Specified by:
y in interface Hep3Vector

z

public double z()
Cartesian z

Specified by:
z in interface Hep3Vector

rxy

public double rxy()
Cylindrical r

Returns:
double

phi

public double phi()
Cylindrical phi

Returns:
double

rxyz

public double rxyz()
Spherical r

Returns:
double

theta

public double theta()
Spherical theta

Returns:
double

cosPhi

public double cosPhi()
cos(phi)


sinPhi

public double sinPhi()
sin(phi)


sinTheta

public double sinTheta()
sin(theta)

Returns:
double

cosTheta

public double cosTheta()
cos(theta)

Returns:
double

toString

public java.lang.String toString()
Output Stream

Overrides:
toString in class java.lang.Object
Returns:
String representation of object

equals

public boolean equals(SpacePoint spt,
                      double precision)
Tests for equality within errors

Parameters:
spt - a SpacePoint to compare against
precision - the precision of the comparison
Returns:
true if each of the components is within precision of the components of spt

equals

public boolean equals(Hep3Vector spt,
                      double precision)
Tests for equality within errors

Parameters:
spt - a Hep3Vector to compare against
precision - the precision of the comparison
Returns:
true if each of the components is within precision of the components of spt

equals

public boolean equals(SpacePoint x)
Tests for equality

Parameters:
x - SpacePoint to compare
Returns:
true if objects are equal

notEquals

public boolean notEquals(SpacePoint spt)
Inequality

Parameters:
spt - SpacePoint to compare
Returns:
true if objects are not equal

distance

public static double distance(SpacePoint spt1,
                              SpacePoint spt2)
Return the distance between two space points.

Parameters:
spt1 - SpacePoint 1
spt2 - SpacePoint 2
Returns:
Euclidean distance between points

clone

public java.lang.Object clone()
Clone

Overrides:
clone in class java.lang.Object
Returns:
a copy of this object

getCartesianArray

public double[] getCartesianArray()
Returns:
array of doubles, cartesian representation

getRepresentation

public SpacePoint.Representation getRepresentation()
Returns:
the representations of the object


Copyright © 2000-2010 FreeHEP. All Rights Reserved.