javax.vecmath

Class Point2d

Implemented Interfaces:
Serializable

public class Point2d
extends Tuple2d
implements Serializable

A 2 element point that is represented by double precision doubleing point x,y coordinates.
Version:
specification 1.1, implementation $Revision: 1.5 $, $Date: 1999/10/05 07:03:50 $
Author:
Kenji hiranabe

Field Summary

Fields inherited from class javax.vecmath.Tuple2d

x, y

Constructor Summary

Point2d()
Constructs and initializes a Point2d to (0,0).
Point2d(double x, double y)
Constructs and initializes a Point2d from the specified xy coordinates.
Point2d(Point2d p1)
Constructs and initializes a Point2d from the specified Point2d.
Point2d(Point2f p1)
Constructs and initializes a Point2d from the specified Point2f.
Point2d(Tuple2d t1)
Constructs and initializes a Point2d from the specified Tuple2d.
Point2d(Tuple2f t1)
Constructs and initializes a Point2d from the specified Tuple2f.
Point2d(p[] )
Constructs and initializes a Point2d from the specified array.

Method Summary

double
distance(Point2d p1)
Computes the distance between this point and point p1.
double
distanceL1(Point2d p1)
Computes the L-1 (Manhattan) distance between this point and point p1.
double
distanceLinf(Point2d p1)
Computes the L-infinite distance between this point and point p1.
double
distanceSquared(Point2d p1)
Computes the square of the distance between this point and point p1.

Methods inherited from class javax.vecmath.Tuple2d

absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, epsilonEquals, equals, equals, get, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, sub, sub, toString

Constructor Details

Point2d

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

Point2d

public Point2d(double x,
               double y)
Constructs and initializes a Point2d from the specified xy coordinates.
Parameters:
x - the x coordinate
y - the y coordinate

Point2d

public Point2d(Point2d p1)
Constructs and initializes a Point2d from the specified Point2d.
Parameters:
p1 - the Point2d containing the initialization x y data

Point2d

public Point2d(Point2f p1)
Constructs and initializes a Point2d from the specified Point2f.
Parameters:
p1 - the Point2f containing the initialization x y data

Point2d

public Point2d(Tuple2d t1)
Constructs and initializes a Point2d from the specified Tuple2d.
Parameters:
t1 - the Tuple2d containing the initialization x y data

Point2d

public Point2d(Tuple2f t1)
Constructs and initializes a Point2d from the specified Tuple2f.
Parameters:
t1 - the Tuple2f containing the initialization x y data

Point2d

public Point2d(p[] )
Constructs and initializes a Point2d from the specified array.
Parameters:

Method Details

distance

public final double distance(Point2d p1)
Computes the distance between this point and point p1.
Parameters:
p1 - the other point

distanceL1

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 - the other point

distanceLinf

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 - the other point

distanceSquared

public final double distanceSquared(Point2d p1)
Computes the square of the distance between this point and point p1.
Parameters:
p1 - the other point