|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.v3x.graphics.Coord
public class Coord
A Coord is an n-dimensional coordinate or offset.
| Field Summary | |
|---|---|
protected double[] |
coords
|
| Constructor Summary | |
|---|---|
Coord()
Default constructor. |
|
Coord(double[] newCoords)
Creates a new Coord from an array of double. |
|
| Method Summary | |
|---|---|
double |
at(int dimension)
Returns the magnitude of a dimension. |
java.lang.Object |
clone()
Clones the Coord. |
protected void |
copyState(Coord from)
Copies contents from another Coord. |
double |
distance(Coord base)
Returns distance from another coord. |
boolean |
equals(java.lang.Object nother)
|
protected java.util.ArrayList |
getCoords()
Get the coordinate vector for this coord. |
int |
getDimensions()
Number of dimensions in the Coord |
int |
hashCode()
Hash value for the object. |
Coord |
round()
Rounds off each magnitude to the nearest integer. |
protected void |
setCoords(java.util.ArrayList coordVec)
Set the coordinate vector for this coord. |
Coord |
stretch(double factor)
Stretch is a uniform expansion or compression by a single factor. |
java.lang.String |
toString()
Returns a formatted string representation of the coordinate in (x, y, z, ...) style. |
Coord |
translate(Coord offset)
Translates a coordinate by an offset. |
Coord |
truncate()
Truncates each magnitude to the next lower integer. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double[] coords
| Constructor Detail |
|---|
public Coord()
public Coord(double[] newCoords)
| Method Detail |
|---|
public int getDimensions()
public double at(int dimension)
public java.lang.Object clone()
clone in class java.lang.Objectprotected void copyState(Coord from)
public Coord translate(Coord offset)
public Coord stretch(double factor)
public Coord round()
public Coord truncate()
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object nother)
equals in class java.lang.Objectpublic double distance(Coord base)
protected java.util.ArrayList getCoords()
protected void setCoords(java.util.ArrayList coordVec)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||