org.jscience.chemistry.gui.extended.geometry
Class GeometryUtils

java.lang.Object
  extended by org.jscience.chemistry.gui.extended.geometry.GeometryUtils

public class GeometryUtils
extends java.lang.Object

A public class that provides mathematical calculation on some geometry entities.

See Also:
Point3D, GeoVector

Constructor Summary
GeometryUtils()
           
 
Method Summary
static Angle angle(Point3D P1, Point3D O, Point3D P2)
          calculate angle among three points in 3D space note: calling Point3D.distSquare() is more efficient than Point3D.distance().
static double distance(Point3D P1, Point3D P2)
          calculate distance between two points in 3D space
static GeoVector3D project(GeoVector3D va, GeoVector3D vb)
          return the projection of va on vb
static GeoVector3D subtract(GeoVector3D va, GeoVector3D vb)
          Return a geometric vector that is the result of subtracting second input geometric vector from the first one.
static GeoVector3D sum(GeoVector3D va, GeoVector3D vb)
          Return a geometric vector that is the result of summation of two input geometric vectors
static Angle torsionAngle(Point3D P1, Point3D P2, Point3D P3, Point3D P4)
          calculate angle among three points in 3D space note: calling Point3D.distSquare() is more efficient than calling Point3D.distance().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometryUtils

public GeometryUtils()
Method Detail

distance

public static double distance(Point3D P1,
                              Point3D P2)
calculate distance between two points in 3D space

Parameters:
P1 - : point 1
P2 - : point 2
Returns:
distance : |P1P2|

angle

public static Angle angle(Point3D P1,
                          Point3D O,
                          Point3D P2)
calculate angle among three points in 3D space note: calling Point3D.distSquare() is more efficient than Point3D.distance().

Parameters:
x1, - y1, z1 : coordinates of point P1
x2, - y2, z2 : coordinates of point O
x3, - y3, z3 : coordinates of point P2
Returns:
angle : angle P1-O-P2

torsionAngle

public static Angle torsionAngle(Point3D P1,
                                 Point3D P2,
                                 Point3D P3,
                                 Point3D P4)
calculate angle among three points in 3D space note: calling Point3D.distSquare() is more efficient than calling Point3D.distance().

Parameters:
x1, - y1, z1 : coordinates of point P1
x2, - y2, z2 : coordinates of point O
x3, - y3, z3 : coordinates of point P2
Returns:
angle : angle P1-O-P2

sum

public static GeoVector3D sum(GeoVector3D va,
                              GeoVector3D vb)
Return a geometric vector that is the result of summation of two input geometric vectors

Parameters:
va - first geometric vector
vb - second geometric vector
Returns:
va+vb

subtract

public static GeoVector3D subtract(GeoVector3D va,
                                   GeoVector3D vb)
Return a geometric vector that is the result of subtracting second input geometric vector from the first one.

Parameters:
va - first geometric vector
vb - second geometric vector
Returns:
va-vb

project

public static GeoVector3D project(GeoVector3D va,
                                  GeoVector3D vb)
return the projection of va on vb