Coordinate

@SerialVersionUID(6683108902428366910L) class Coordinate(var x: Double, var y: Double, var z: Double) extends Comparable[Coordinate] with Cloneable with Serializable
Companion
object
trait Serializable
trait Cloneable
trait Comparable[Coordinate]
class Object
trait Matchable
class Any

Value members

Constructors

def this(c: Coordinate)

Constructs a <code>Coordinate</code> having the same (x,y,z) values as <code>other</code>.

Constructs a <code>Coordinate</code> having the same (x,y,z) values as <code>other</code>.

Value Params
c

the <code>Coordinate</code> to copy.

def this(x: Double, y: Double)

Constructs a <code>Coordinate</code> at (x,y,NaN).

Constructs a <code>Coordinate</code> at (x,y,NaN).

Value Params
x

the x-value

y

the y-value

def this()

Constructs a <code>Coordinate</code> at (0,0,NaN).

Constructs a <code>Coordinate</code> at (0,0,NaN).

Concrete methods

override def clone: Coordinate
Definition Classes
Object
override def compareTo(o: Coordinate): Int

Compares this {link Coordinate} with the specified {link Coordinate} for order. This method ignores the z value when making the comparison. Returns:

Compares this {link Coordinate} with the specified {link Coordinate} for order. This method ignores the z value when making the comparison. Returns:

<UL> <LI> -1 : this.x &lt; other.x || ((this.x == other.x) &amp;&amp; (this.y &lt; other.y)) <LI> 0 : this.x == other.x &amp;&amp; this.y = other.y <LI> 1 : this.x &gt; other.x || ((this.x == other.x) &amp;&amp; (this.y &gt; other.y))

</UL> Note: This method assumes that ordinate values are valid numbers. NaN values are not handled correctly.

Value Params
o

the <code>Coordinate</code> with which this <code>Coordinate</code> is being compared return -1, zero, or 1 as this <code>Coordinate</code> is less than, equal to, or greater than the specified <code>Coordinate</code>

Definition Classes
Comparable

Creates a copy of this Coordinate.

Creates a copy of this Coordinate.

return a copy of this coordinate.

def distance(c: Coordinate): Double

Computes the 2-dimensional Euclidean distance to another location. The Z-ordinate is ignored.

Computes the 2-dimensional Euclidean distance to another location. The Z-ordinate is ignored.

Value Params
c

a point return the 2-dimensional Euclidean distance between the locations

def distance3D(c: Coordinate): Double

Computes the 3-dimensional Euclidean distance to another location.

Computes the 3-dimensional Euclidean distance to another location.

Value Params
c

a coordinate return the 3-dimensional Euclidean distance between the locations

def equalInZ(c: Coordinate, tolerance: Double): Boolean

Tests if another coordinate has the same value for Z, within a tolerance.

Tests if another coordinate has the same value for Z, within a tolerance.

Value Params
c

a coordinate

tolerance

the tolerance value return true if the Z ordinates are within the given tolerance

override def equals(other: Any): Boolean

Returns <code>true</code> if <code>other</code> has the same values for the x and y ordinates. Since Coordinates are 2.5D, this routine ignores the z value when making the comparison.

Returns <code>true</code> if <code>other</code> has the same values for the x and y ordinates. Since Coordinates are 2.5D, this routine ignores the z value when making the comparison.

Value Params
other

a <code>Coordinate</code> with which to do the comparison. return <code>true</code> if <code>other</code> is a <code>Coordinate</code> with the same values for the x and y ordinates.

Definition Classes
Any
def equals2D(other: Coordinate): Boolean

Returns whether the planar projections of the two <code>Coordinate</code>s are equal.

Returns whether the planar projections of the two <code>Coordinate</code>s are equal.

Value Params
other

a <code>Coordinate</code> with which to do the 2D comparison. return <code>true</code> if the x- and y-coordinates are equal; the z-coordinates do not have to be equal.

def equals2D(c: Coordinate, tolerance: Double): Boolean

Tests if another Coordinate has the same values for the X and Y ordinates, within a specified tolerance value. The Z ordinate is ignored.

Tests if another Coordinate has the same values for the X and Y ordinates, within a specified tolerance value. The Z ordinate is ignored.

Value Params
c

a <code>Coordinate</code> with which to do the 2D comparison.

tolerance

the tolerance value to use return true if <code>other</code> is a <code>Coordinate</code> with the same values for X and Y.

def equals3D(other: Coordinate): Boolean

Tests if another coordinate has the same values for the X, Y and Z ordinates.

Tests if another coordinate has the same values for the X, Y and Z ordinates.

Value Params
other

a <code>Coordinate</code> with which to do the 3D comparison. return true if <code>other</code> is a <code>Coordinate</code> with the same values for X, Y and Z.

def getM: Double

Retrieves the value of the measure, if present. If no measure value is present returns <tt>NaN</tt>.

Retrieves the value of the measure, if present. If no measure value is present returns <tt>NaN</tt>.

return the value of the measure, or <tt>NaN</tt>

@nowarn
def getOrdinate(ordinateIndex: Int): Double

Gets the ordinate value for the given index.

Gets the ordinate value for the given index.

The base implementation supports values for the index are {link X}, {link Y}, and {link Z}.

Value Params
ordinateIndex

the ordinate index return the value of the ordinate throws IllegalArgumentException if the index is not valid

def getX: Double

Retrieves the value of the X ordinate.

Retrieves the value of the X ordinate.

return the value of the X ordinate

def getY: Double

Retrieves the value of the Y ordinate.

Retrieves the value of the Y ordinate.

return the value of the Y ordinate

def getZ: Double

Retrieves the value of the Z ordinate, if present. If no Z value is present returns <tt>NaN</tt>.

Retrieves the value of the Z ordinate, if present. If no Z value is present returns <tt>NaN</tt>.

return the value of the Z ordinate, or <tt>NaN</tt>

override def hashCode: Int

Gets a hashcode for this coordinate.

Gets a hashcode for this coordinate.

return a hashcode for this coordinate

Definition Classes
Any
def setCoordinate(other: Coordinate): Unit

Sets this <code>Coordinate</code>s (x,y,z) values to that of <code>other</code>.

Sets this <code>Coordinate</code>s (x,y,z) values to that of <code>other</code>.

Value Params
other

the <code>Coordinate</code> to copy

def setM(m: Double): Unit

Sets the measure value, if supported.

Sets the measure value, if supported.

Value Params
m

the value to set as M

def setOrdinate(ordinateIndex: Int, value: Double): Unit

Sets the ordinate for the given index to a given value.

Sets the ordinate for the given index to a given value.

The base implementation supported values for the index are {link X}, {link Y}, and {link Z}.

Value Params
ordinateIndex

the ordinate index

value

the value to set throws IllegalArgumentException if the index is not valid

def setX(x: Double): Unit

Sets the X ordinate value.

Sets the X ordinate value.

Value Params
x

the value to set as X

def setY(y: Double): Unit

Sets the Y ordinate value.

Sets the Y ordinate value.

Value Params
y

the value to set as Y

def setZ(z: Double): Unit

Sets the Z ordinate value.

Sets the Z ordinate value.

Value Params
z

the value to set as Z

override def toString: String

Returns a <code>String</code> of the form <I>(x,y,z)</I> .

Returns a <code>String</code> of the form <I>(x,y,z)</I> .

return a <code>String</code> of the form <I>(x,y,z)</I>

Definition Classes
Any

Concrete fields

var x: Double
var y: Double
var z: Double