Top Description Fields Constructors Methods
javax.vecmath

public Class Point2f

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

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

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
Point2f(float
the x coordinate
x
,
float
the y coordinate
y
)

Constructs and initializes a Point2f from the specified xy coordinates.

public
Point2f(float[]
the array of length 2 containing xy in order
p
)

Constructs and initializes a Point2f from the specified array.

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

Constructs and initializes a Point2f from the specified Point2f.

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

Constructs and initializes a Point2f from the specified Point2d.

public
Point2f(Tuple2d
the Tuple2d containing the initialization x y z data
t1
)

Constructs and initializes a Point2f from the specified Tuple2d.

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

Constructs and initializes a Point2f from the specified Tuple2f.

public
Point2f()

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

Method Summary

Modifier and TypeMethod and Description
public final float
distance(Point2f
the other point
p1
)

Computes the distance between this point and point p1.

public final float
distanceL1(Point2f
the other point
p1
)

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

public final float
distanceLinf(Point2f
the other point
p1
)

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

public final float
distanceSquared(Point2f
the other point
p1
)

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

Inherited from javax.vecmath.Tuple2f:
absoluteabsoluteaddaddclampclampclampMaxclampMaxclampMinclampMincloneepsilonEqualsequalsequalsgetgetXgetYhashCodeinterpolateinterpolatenegatenegatescalescalescaleAddscaleAddsetsetsetsetsetXsetYsubsubtoString

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.vecmath.Tuple2f.serialVersionUID.

Constructor Detail

Point2fback to summary
public Point2f(float x, float y)

Constructs and initializes a Point2f from the specified xy coordinates.

Parameters
x:float

the x coordinate

y:float

the y coordinate

Point2fback to summary
public Point2f(float[] p)

Constructs and initializes a Point2f from the specified array.

Parameters
p:float[]

the array of length 2 containing xy in order

Point2fback to summary
public Point2f(Point2f p1)

Constructs and initializes a Point2f from the specified Point2f.

Parameters
p1:Point2f

the Point2f containing the initialization x y data

Point2fback to summary
public Point2f(Point2d p1)

Constructs and initializes a Point2f from the specified Point2d.

Parameters
p1:Point2d

the Point2d containing the initialization x y z data

Point2fback to summary
public Point2f(Tuple2d t1)

Constructs and initializes a Point2f from the specified Tuple2d.

Parameters
t1:Tuple2d

the Tuple2d containing the initialization x y z data

Point2fback to summary
public Point2f(Tuple2f t1)

Constructs and initializes a Point2f from the specified Tuple2f.

Parameters
t1:Tuple2f

the Tuple2f containing the initialization x y data

Point2fback to summary
public Point2f()

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

Method Detail

distanceback to summary
public final float distance(Point2f p1)

Computes the distance between this point and point p1.

Parameters
p1:Point2f

the other point

distanceL1back to summary
public final float distanceL1(Point2f 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:Point2f

the other point

distanceLinfback to summary
public final float distanceLinf(Point2f 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:Point2f

the other point

distanceSquaredback to summary
public final float distanceSquared(Point2f p1)

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

Parameters
p1:Point2f

the other point