Top Description Fields Constructors Methods
com.sun.javafx.geom

public Class Vec2d

extends Object
Class Inheritance

A 2-dimensional, double-precision, floating-point vector.

Field Summary

Modifier and TypeField and Description
public double
x

The x coordinate.

public double
y

The y coordinate.

Constructor Summary

AccessConstructor and Description
public
public
Vec2d(double x, double y)

public
public

Method Summary

Modifier and TypeMethod and Description
public static double

Returns:

the distance between the two sets of specified coordinates.
distance
(double
the X coordinate of the first specified point
x1
,
double
the Y coordinate of the first specified point
y1
,
double
the X coordinate of the second specified point
x2
,
double
the Y coordinate of the second specified point
y2
)

Returns the distance between two points.

public double

Returns:

the distance between this Vec2d and a specified point.
distance
(double
the X coordinate of the specified point to be measured against this Vec2d
vx
,
double
the Y coordinate of the specified point to be measured against this Vec2d
vy
)

Returns the distance from this Vec2d to a specified point.

public double

Returns:

the distance between this Vec2d and the specified Vec2d.
distance
(Vec2d
the specified point to be measured against this Vec2d
v
)

Returns the distance from this Vec2d to a specified Vec2d.

public static double

Returns:

the square of the distance between the two sets of specified coordinates.
distanceSq
(double
the X coordinate of the first specified point
x1
,
double
the Y coordinate of the first specified point
y1
,
double
the X coordinate of the second specified point
x2
,
double
the Y coordinate of the second specified point
y2
)

Returns the square of the distance between two points.

public double

Returns:

the square of the distance between this Vec2d and the specified point.
distanceSq
(double
the X coordinate of the specified point to be measured against this Vec2d
vx
,
double
the Y coordinate of the specified point to be measured against this Vec2d
vy
)

Returns the square of the distance from this Vec2d to a specified point.

public double

Returns:

the square of the distance between this Vec2d to a specified Vec2d.
distanceSq
(Vec2d
the specified point to be measured against this Vec2d
v
)

Returns the square of the distance from this Vec2d to a specified Vec2d.

public boolean

Returns:

true if the object to be compared is an instance of Vec2d and has the same values; false otherwise.
equals
(Object
an object to be compared with this Vec2d
obj
)

Overrides java.lang.Object.equals.

Determines whether or not two 2D points or vectors are equal.

public int

Returns:

a hash code for this Vec2d.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hashcode for this Vec2d.

public void
public void
public void
set(double x, double y)

public String

Returns:

a string representation of this Vec2d.
toString
()

Overrides java.lang.Object.toString.

Returns a String that represents the value of this Vec2d.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

xback to summary
public double x

The x coordinate.

yback to summary
public double y

The y coordinate.

Constructor Detail

Vec2dback to summary
public Vec2d()
Vec2dback to summary
public Vec2d(double x, double y)
Vec2dback to summary
public Vec2d(Vec2d v)
Vec2dback to summary
public Vec2d(Vec2f v)

Method Detail

distanceback to summary
public static double distance(double x1, double y1, double x2, double y2)

Returns the distance between two points.

Parameters
x1:double

the X coordinate of the first specified point

y1:double

the Y coordinate of the first specified point

x2:double

the X coordinate of the second specified point

y2:double

the Y coordinate of the second specified point

Returns:double

the distance between the two sets of specified coordinates.

distanceback to summary
public double distance(double vx, double vy)

Returns the distance from this Vec2d to a specified point.

Parameters
vx:double

the X coordinate of the specified point to be measured against this Vec2d

vy:double

the Y coordinate of the specified point to be measured against this Vec2d

Returns:double

the distance between this Vec2d and a specified point.

distanceback to summary
public double distance(Vec2d v)

Returns the distance from this Vec2d to a specified Vec2d.

Parameters
v:Vec2d

the specified point to be measured against this Vec2d

Returns:double

the distance between this Vec2d and the specified Vec2d.

distanceSqback to summary
public static double distanceSq(double x1, double y1, double x2, double y2)

Returns the square of the distance between two points.

Parameters
x1:double

the X coordinate of the first specified point

y1:double

the Y coordinate of the first specified point

x2:double

the X coordinate of the second specified point

y2:double

the Y coordinate of the second specified point

Returns:double

the square of the distance between the two sets of specified coordinates.

distanceSqback to summary
public double distanceSq(double vx, double vy)

Returns the square of the distance from this Vec2d to a specified point.

Parameters
vx:double

the X coordinate of the specified point to be measured against this Vec2d

vy:double

the Y coordinate of the specified point to be measured against this Vec2d

Returns:double

the square of the distance between this Vec2d and the specified point.

distanceSqback to summary
public double distanceSq(Vec2d v)

Returns the square of the distance from this Vec2d to a specified Vec2d.

Parameters
v:Vec2d

the specified point to be measured against this Vec2d

Returns:double

the square of the distance between this Vec2d to a specified Vec2d.

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Determines whether or not two 2D points or vectors are equal. Two instances of Vec2d are equal if the values of their x and y member fields, representing their position in the coordinate space, are the same.

Parameters
obj:Object

an object to be compared with this Vec2d

Returns:boolean

true if the object to be compared is an instance of Vec2d and has the same values; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hashcode for this Vec2d.

Returns:int

a hash code for this Vec2d.

Annotations
@Override
setback to summary
public void set(Vec2d v)
setback to summary
public void set(Vec2f v)
setback to summary
public void set(double x, double y)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a String that represents the value of this Vec2d.

Returns:String

a string representation of this Vec2d.

Annotations
@Override