us.ihmc.utilities.math.geometry
Class FrameLine2d

java.lang.Object
  extended by us.ihmc.utilities.math.geometry.FrameLine2d
All Implemented Interfaces:
FrameGeometry2d, ReferenceFrameHolder

public class FrameLine2d
extends java.lang.Object
implements ReferenceFrameHolder, FrameGeometry2d

Title:

Description:

Copyright: Copyright (c) 2007

Company:

Version:
1.0
Author:
Twan Koolen

Constructor Summary
FrameLine2d(FrameLine2d frameLine2d)
           
FrameLine2d(FrameLineSegment2d frameLineSegment2d)
           
FrameLine2d(FramePoint2d firstPointOnLine, FramePoint2d secondPointOnLine)
           
FrameLine2d(FramePoint2d framePoint2d, FrameVector2d frameVector2d)
           
FrameLine2d(ReferenceFrame referenceFrame, Line2d line2d)
           
FrameLine2d(ReferenceFrame referenceFrame, javax.vecmath.Point2d firstPointOnLine, javax.vecmath.Point2d secondPointOnLine)
           
FrameLine2d(ReferenceFrame referenceFrame, javax.vecmath.Point2d point2d, javax.vecmath.Vector2d vector2d)
           
 
Method Summary
 FrameLine2d applyTransformCopy(javax.media.j3d.Transform3D transform, ReferenceFrame newFrame, boolean requirePlanarTransform)
          applyTransformCopy Use of this method is discouraged.
 void changeFrame(ReferenceFrame desiredFrame)
           
 void changeFrame(ReferenceFrame desiredFrame, boolean requireTransformInPlane)
           
 FrameLine2d changeFrameCopy(ReferenceFrame desiredFrame)
           
 FrameLine2d changeFrameCopy(ReferenceFrame desiredFrame, boolean requireTransformInPlane)
           
 void checkReferenceFrameMatch(ReferenceFrame frame)
           
 void checkReferenceFrameMatch(ReferenceFrameHolder referenceFrameHolder)
           
 boolean containsEpsilon(FramePoint2d framePoint, double epsilon)
           
 double distance(FrameConvexPolygon2d convexPolygon)
           
 double distance(FrameLine2d secondLine)
           
 double distance(FrameLineSegment2d lineSegment)
           
 double distance(FramePoint2d point)
           
static FrameLine2d generateRandomFrameLine2d(java.util.Random random, ReferenceFrame zUpFrame, double xMin, double xMax, double yMin, double yMax)
           
 FramePoint2d getFramePoint2dGivenParameter(double t)
           
 FramePoint2d getFramePointCopy()
           
 FrameVector2d getFrameVectorCopy()
           
 Line2d getLine2d()
           
 Line2d getLine2dCopy()
           
 FrameVector2d getNormalizedFrameVector()
           
 double getParameterGivenPointEpsilon(FramePoint2d point, double epsilon)
           
 ReferenceFrame getReferenceFrame()
           
 FrameLine2d interiorBisector(FrameLine2d secondLine)
           
 FramePoint2d[] intersectionWith(FrameConvexPolygon2d convexPolygon)
           
 FramePoint2d intersectionWith(FrameLine2d secondLine)
           
 FramePoint2d intersectionWith(FrameLineSegment2d lineSegment)
           
 boolean isPointBehindLine(FramePoint2d point)
           
 boolean isPointInFrontOfLine(FramePoint2d point)
          isPointInFrontOfLine returns whether the point is in front of the line or not.
 boolean isPointOnLeftSideOfLine(FramePoint2d point)
           
 boolean isPointOnRightSideOfLine(FramePoint2d point)
           
 void negateDirection()
           
 FrameLine2d negateDirectionCopy()
           
 void orthogonalProjection(FramePoint2d point)
           
 FramePoint2d orthogonalProjectionCopy(FramePoint2d point)
           
 FrameVector2d perpendicularFrameVector()
           
static FrameLine2d perpendicularLineThroughPoint(FrameLine2d line, FramePoint2d point)
           
 void rotate(double radians)
           
 void set(FrameLine2d frameLine2d)
           
 void set(FramePoint2d[] endpoints)
           
 void set(FramePoint2d endpoint0, FramePoint2d endpoint1)
           
 void set(ReferenceFrame referenceFrame, double x0, double y0, double vx, double vy)
           
 void setFramePoint2d(FramePoint2d framePoint2d)
           
 void setParallelLineThroughPoint(FramePoint2d point)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrameLine2d

public FrameLine2d(ReferenceFrame referenceFrame,
                   Line2d line2d)

FrameLine2d

public FrameLine2d(ReferenceFrame referenceFrame,
                   javax.vecmath.Point2d point2d,
                   javax.vecmath.Vector2d vector2d)

FrameLine2d

public FrameLine2d(ReferenceFrame referenceFrame,
                   javax.vecmath.Point2d firstPointOnLine,
                   javax.vecmath.Point2d secondPointOnLine)

FrameLine2d

public FrameLine2d(FramePoint2d framePoint2d,
                   FrameVector2d frameVector2d)

FrameLine2d

public FrameLine2d(FramePoint2d firstPointOnLine,
                   FramePoint2d secondPointOnLine)

FrameLine2d

public FrameLine2d(FrameLine2d frameLine2d)

FrameLine2d

public FrameLine2d(FrameLineSegment2d frameLineSegment2d)
Method Detail

getLine2d

public Line2d getLine2d()

getLine2dCopy

public Line2d getLine2dCopy()

getFramePointCopy

public FramePoint2d getFramePointCopy()

getFrameVectorCopy

public FrameVector2d getFrameVectorCopy()

getNormalizedFrameVector

public FrameVector2d getNormalizedFrameVector()

getFramePoint2dGivenParameter

public FramePoint2d getFramePoint2dGivenParameter(double t)

getParameterGivenPointEpsilon

public double getParameterGivenPointEpsilon(FramePoint2d point,
                                            double epsilon)

containsEpsilon

public boolean containsEpsilon(FramePoint2d framePoint,
                               double epsilon)

negateDirection

public void negateDirection()

negateDirectionCopy

public FrameLine2d negateDirectionCopy()

rotate

public void rotate(double radians)

setFramePoint2d

public void setFramePoint2d(FramePoint2d framePoint2d)

set

public void set(FramePoint2d endpoint0,
                FramePoint2d endpoint1)

set

public void set(FramePoint2d[] endpoints)

set

public void set(ReferenceFrame referenceFrame,
                double x0,
                double y0,
                double vx,
                double vy)

set

public void set(FrameLine2d frameLine2d)

interiorBisector

public FrameLine2d interiorBisector(FrameLine2d secondLine)

perpendicularFrameVector

public FrameVector2d perpendicularFrameVector()

perpendicularLineThroughPoint

public static FrameLine2d perpendicularLineThroughPoint(FrameLine2d line,
                                                        FramePoint2d point)

checkReferenceFrameMatch

public void checkReferenceFrameMatch(ReferenceFrameHolder referenceFrameHolder)
Specified by:
checkReferenceFrameMatch in interface ReferenceFrameHolder

checkReferenceFrameMatch

public void checkReferenceFrameMatch(ReferenceFrame frame)
                              throws ReferenceFrameMismatchException
Specified by:
checkReferenceFrameMatch in interface ReferenceFrameHolder
Throws:
ReferenceFrameMismatchException

getReferenceFrame

public ReferenceFrame getReferenceFrame()
Specified by:
getReferenceFrame in interface ReferenceFrameHolder

changeFrameCopy

public FrameLine2d changeFrameCopy(ReferenceFrame desiredFrame)
Specified by:
changeFrameCopy in interface ReferenceFrameHolder

changeFrameCopy

public FrameLine2d changeFrameCopy(ReferenceFrame desiredFrame,
                                   boolean requireTransformInPlane)

changeFrame

public void changeFrame(ReferenceFrame desiredFrame)

changeFrame

public void changeFrame(ReferenceFrame desiredFrame,
                        boolean requireTransformInPlane)

applyTransformCopy

public FrameLine2d applyTransformCopy(javax.media.j3d.Transform3D transform,
                                      ReferenceFrame newFrame,
                                      boolean requirePlanarTransform)
applyTransformCopy Use of this method is discouraged. Only use it to speed up computation FrameLine2ds en masse, and only when the desired reference frame is not a parent or child of the current reference frame.

Parameters:
transform - Transform3D
newFrame - ReferenceFrame
requirePlanarTransform - boolean
Returns:
FrameConvexPolygon2d

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

orthogonalProjection

public void orthogonalProjection(FramePoint2d point)
Specified by:
orthogonalProjection in interface FrameGeometry2d

orthogonalProjectionCopy

public FramePoint2d orthogonalProjectionCopy(FramePoint2d point)
Specified by:
orthogonalProjectionCopy in interface FrameGeometry2d

intersectionWith

public FramePoint2d intersectionWith(FrameLine2d secondLine)
Specified by:
intersectionWith in interface FrameGeometry2d

intersectionWith

public FramePoint2d intersectionWith(FrameLineSegment2d lineSegment)
Specified by:
intersectionWith in interface FrameGeometry2d

intersectionWith

public FramePoint2d[] intersectionWith(FrameConvexPolygon2d convexPolygon)
Specified by:
intersectionWith in interface FrameGeometry2d

distance

public double distance(FramePoint2d point)
Specified by:
distance in interface FrameGeometry2d

distance

public double distance(FrameLine2d secondLine)
Specified by:
distance in interface FrameGeometry2d

distance

public double distance(FrameLineSegment2d lineSegment)
Specified by:
distance in interface FrameGeometry2d

distance

public double distance(FrameConvexPolygon2d convexPolygon)
Specified by:
distance in interface FrameGeometry2d

isPointOnLeftSideOfLine

public boolean isPointOnLeftSideOfLine(FramePoint2d point)

isPointOnRightSideOfLine

public boolean isPointOnRightSideOfLine(FramePoint2d point)

isPointInFrontOfLine

public boolean isPointInFrontOfLine(FramePoint2d point)
isPointInFrontOfLine returns whether the point is in front of the line or not. The front direction is defined as the positive x-direction

Parameters:
point - FramePoint2d
Returns:
boolean

isPointBehindLine

public boolean isPointBehindLine(FramePoint2d point)

setParallelLineThroughPoint

public void setParallelLineThroughPoint(FramePoint2d point)

generateRandomFrameLine2d

public static FrameLine2d generateRandomFrameLine2d(java.util.Random random,
                                                    ReferenceFrame zUpFrame,
                                                    double xMin,
                                                    double xMax,
                                                    double yMin,
                                                    double yMax)