Top Description Fields Constructors Methods
javax.vecmath

public Class Point2d

extends Tuple2d
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.lang.Math

A 2 element point that is represented by double precision floating point x,y coordinates.

Field Summary

Modifier and TypeField and Description
pack-priv static final long
Inherited from javax.vecmath.Tuple2d:
xy

Constructor Summary

AccessConstructor and Description
public
Point2d(double
the x coordinate
x
,
double
the y coordinate
y
)

Constructs and initializes a Point2d from the specified xy coordinates.

public
Point2d(double[]
the array of length 2 containing xy in order
p
)

Constructs and initializes a Point2d from the specified array.

public
Point2d(Point2d
the Point2d containing the initialization x y data
p1
)

Constructs and initializes a Point2d from the specified Point2d.

public
Point2d(Point2f
the Point2f containing the initialization x y data
p1
)

Constructs and initializes a Point2d from the specified Point2f.

public
Point2d(Tuple2d
the Tuple2d containing the initialization x y data
t1
)

Constructs and initializes a Point2d from the specified Tuple2d.

public
Point2d(Tuple2f
the Tuple2f containing the initialization x y data
t1
)

Constructs and initializes a Point2d from the specified Tuple2f.

public
Point2d()

Constructs and initializes a Point2d to (0,0).

Method Summary

Modifier and TypeMethod and Description
public final double
distance(Point2d
the other point
p1
)

Computes the distance between this point and point p1.

public final double
distanceL1(Point2d
the other point
p1
)

Computes the L-1 (Manhattan) distance between this point and point p1.

public final double
distanceLinf(Point2d
the other point
p1
)

Computes the L-infinite distance between this point and point p1.

public final double
distanceSquared(Point2d
the other point
p1
)

Computes the square of the distance between this point and point p1.

Inherited from javax.vecmath.Tuple2d:
absoluteabsoluteaddaddclampclampclampMaxclampMaxclampMinclampMincloneepsilonEqualsequalsequalsgetgetXgetYhashCodeinterpolateinterpolatenegatenegatescalescalescaleAddscaleAddsetsetsetsetsetXsetYsubsubtoString

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.vecmath.Tuple2d.serialVersionUID.

Constructor Detail

Point2dback to summary
public Point2d(double x, double y)

Constructs and initializes a Point2d from the specified xy coordinates.

Parameters
x:double

the x coordinate

y:double

the y coordinate

Point2dback to summary
public Point2d(double[] p)

Constructs and initializes a Point2d from the specified array.

Parameters
p:double[]

the array of length 2 containing xy in order

Point2dback to summary
public Point2d(Point2d p1)

Constructs and initializes a Point2d from the specified Point2d.

Parameters
p1:Point2d

the Point2d containing the initialization x y data

Point2dback to summary
public Point2d(Point2f p1)

Constructs and initializes a Point2d from the specified Point2f.

Parameters
p1:Point2f

the Point2f containing the initialization x y data

Point2dback to summary
public Point2d(Tuple2d t1)

Constructs and initializes a Point2d from the specified Tuple2d.

Parameters
t1:Tuple2d

the Tuple2d containing the initialization x y data

Point2dback to summary
public Point2d(Tuple2f t1)

Constructs and initializes a Point2d from the specified Tuple2f.

Parameters
t1:Tuple2f

the Tuple2f containing the initialization x y data

Point2dback to summary
public Point2d()

Constructs and initializes a Point2d to (0,0).

Method Detail

distanceback to summary
public final double distance(Point2d p1)

Computes the distance between this point and point p1.

Parameters
p1:Point2d

the other point

distanceL1back to summary
public final double distanceL1(Point2d p1)

Computes the L-1 (Manhattan) distance between this point and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).

Parameters
p1:Point2d

the other point

distanceLinfback to summary
public final double distanceLinf(Point2d p1)

Computes the L-infinite distance between this point and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].

Parameters
p1:Point2d

the other point

distanceSquaredback to summary
public final double distanceSquared(Point2d p1)

Computes the square of the distance between this point and point p1.

Parameters
p1:Point2d

the other point