es.ucm.look.ar.math.geom
Class Point3

java.lang.Object
  extended by es.ucm.look.ar.math.geom.Point2
      extended by es.ucm.look.ar.math.geom.Point3
Direct Known Subclasses:
Vector3

public class Point3
extends Point2

Represents a 3D point


Field Summary
 float z
          z coordinate
 
Fields inherited from class es.ucm.look.ar.math.geom.Point2
x, y
 
Constructor Summary
Point3(float x, float y, float z)
          Constructs a 3D point
Point3(Point3 p)
           
 
Method Summary
 void add(float x, float y, float z)
          Adds given coordinates to 3D point coordinates
 void add(Point3 p)
          Adds the point's coordinates
 float[] array()
          Returns a three dimension array with the coordinates
 float[] getCoordinatesArray()
          Returns an array with the point's coordinates
static Point3 getVolatilePoint(float x, float y, float z)
           
 void inverseScale(Point3 scale)
          Scales the point, dividing the current coordinates with the given scale
 void scale(Point3 scale)
          Scales the point, multiplying the current coordinates with the given scale
 void set(float[] floatArray)
           
 void set(float x, float y, float z)
          Sets point coordinates
 void set(Point3 p)
          Copies the coordinates of the given point
 void subtract(Point3 p)
          Subtracts the point's coordinates
 java.lang.String toString()
           
 
Methods inherited from class es.ucm.look.ar.math.geom.Point2
add, add
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

z

public float z
z coordinate

Constructor Detail

Point3

public Point3(float x,
              float y,
              float z)
Constructs a 3D point

Parameters:
x - x coordinate
y - y coordinate
z - z coordinate

Point3

public Point3(Point3 p)
Method Detail

add

public void add(float x,
                float y,
                float z)
Adds given coordinates to 3D point coordinates

Parameters:
x - x coordinate
y - y coordinate
z - z coordinate

add

public void add(Point3 p)
Adds the point's coordinates

Parameters:
p - the point

array

public float[] array()
Returns a three dimension array with the coordinates

Returns:

getCoordinatesArray

public float[] getCoordinatesArray()
Description copied from class: Point2
Returns an array with the point's coordinates

Overrides:
getCoordinatesArray in class Point2
Returns:
an array with the point's coordinates

getVolatilePoint

public static Point3 getVolatilePoint(float x,
                                      float y,
                                      float z)

inverseScale

public void inverseScale(Point3 scale)
Scales the point, dividing the current coordinates with the given scale

Parameters:
scale - the scale

scale

public void scale(Point3 scale)
Scales the point, multiplying the current coordinates with the given scale

Parameters:
scale - the scale

set

public void set(float[] floatArray)

set

public void set(float x,
                float y,
                float z)
Sets point coordinates

Parameters:
x - x coordinate
y - y coordinate
z - z coordinate

set

public void set(Point3 p)
Copies the coordinates of the given point

Parameters:
p - the point

subtract

public void subtract(Point3 p)
Subtracts the point's coordinates

Parameters:
p - the point

toString

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