quicktime.qd3d.math
Class Point2D

java.lang.Object
  |
  +--quicktime.qd3d.math.Point2D
All Implemented Interfaces:
quicktime.jdirect.InterfaceLib, quicktime.jdirect.PrimitivesLib, quicktime.jdirect.QuickDraw3DLib, quicktime.jdirect.QuickTimeLib, quicktime.jdirect.SharedLibrary, com.apple.jdirect.SharedLibrary

public final class Point2D
extends java.lang.Object
implements quicktime.jdirect.QuickTimeLib, quicktime.jdirect.QuickDraw3DLib

Point2D contains static calls - the implementation is found in the QDPoint class

See Also:
refer to Q3Point2D in QuickDraw3D

Fields inherited from interface quicktime.jdirect.QuickTimeLib
JDirect_MacOSX, libraryInstance, name
 
Fields inherited from interface quicktime.jdirect.QuickDraw3DLib
libraryInstance
 
Method Summary
static QDPoint add(QDPoint point2D, Vector2D v)
          Returns the result of adding a two-dimensional vector to a two-dimensional point.
static float distance(QDPoint p1, QDPoint p2)
          Returns the absolute value of the distance between points p1 and p2.
static float distanceSquared(QDPoint p1, QDPoint p2)
          Returns the square value of the distance between points p1 and p2.
static QDPoint rRatio(QDPoint p1, QDPoint p2, float r1, float r2)
          Returns the two-dimensional point that lies on the line segment between the points p1 and p2 and that is at a distance from the first point determined by the ratio r1/(r1 + r2).
static Vector2D subtract(QDPoint p1, QDPoint p2)
          Returns a two-dimensional vector that is the result of subtracting the point p2 from p1.
static QDPoint subtract(QDPoint point2D, Vector2D v)
          Returns the result of subtracting a two-dimensional vector from a two-dimensional point.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

subtract

public static Vector2D subtract(QDPoint p1,
                                QDPoint p2)
Returns a two-dimensional vector that is the result of subtracting the point p2 from p1.

QuickDraw3D::Q3Point2D_Subtract

Parameters:
p1 - A two-dimensional point
p2 - A two-dimensional point
Returns:
a Vector2D object

distance

public static float distance(QDPoint p1,
                             QDPoint p2)
Returns the absolute value of the distance between points p1 and p2.

QuickDraw3D::Q3Point2D_Distance

Parameters:
p1 - A two-dimensional point
p2 - A two-dimensional point
Returns:
the distance

distanceSquared

public static float distanceSquared(QDPoint p1,
                                    QDPoint p2)
Returns the square value of the distance between points p1 and p2.

QuickDraw3D::Q3Point2D_DistanceSquared

Parameters:
p1 - A two-dimensional point
p2 - A two-dimensional point
Returns:
the distance

rRatio

public static QDPoint rRatio(QDPoint p1,
                             QDPoint p2,
                             float r1,
                             float r2)
Returns the two-dimensional point that lies on the line segment between the points p1 and p2 and that is at a distance from the first point determined by the ratio r1/(r1 + r2).

QuickDraw3D::Q3Point2D_RRatio

Parameters:
p2 - A two-dimensional point.
r1 - A floating-point number.
r2 - A floating-point number.
Returns:
a QDPoint

add

public static QDPoint add(QDPoint point2D,
                          Vector2D v)
Returns the result of adding a two-dimensional vector to a two-dimensional point.

QuickDraw3D::Q3Point2D_Vector2D_Add

Parameters:
point2D - A two-dimensional point.
v - a two-dimensional vector
Returns:
a point that is the result of the add.

subtract

public static QDPoint subtract(QDPoint point2D,
                               Vector2D v)
Returns the result of subtracting a two-dimensional vector from a two-dimensional point.

QuickDraw3D::Q3Point2D_Vector2D_Subtract

Parameters:
point2D - A two-dimensional point.
v - a two-dimensional vector
Returns:
a point that is the result of the add.