us.ihmc.utilities.math.geometry
Class FrameLineSegment2d

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

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

Title:

Description:

Copyright: Copyright (c) 2007

Company:

Version:
1.0
Author:
Twan Koolen

Constructor Summary
FrameLineSegment2d(FrameLineSegment2d frameLineSegment2d)
           
FrameLineSegment2d(FramePoint2d[] endpoints)
           
FrameLineSegment2d(FramePoint2d endpoint1, FramePoint2d endpoint2)
           
FrameLineSegment2d(ReferenceFrame referenceFrame, LineSegment2d lineSegment2d)
           
FrameLineSegment2d(ReferenceFrame referenceFrame, javax.vecmath.Point2d[] endpoints)
           
FrameLineSegment2d(ReferenceFrame referenceFrame, javax.vecmath.Point2d endpoint1, javax.vecmath.Point2d endpoint2)
           
 
Method Summary
 FrameLineSegment2d 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)
           
 FrameLineSegment2d changeFrameCopy(ReferenceFrame desiredFrame)
           
 FrameLineSegment2d changeFrameCopy(ReferenceFrame desiredFrame, boolean requireTransformInPlane)
           
 void checkReferenceFrameMatch(ReferenceFrame frame)
           
 void checkReferenceFrameMatch(ReferenceFrameHolder referenceFrameHolder)
           
 double distance(FrameConvexPolygon2d convexPolygon)
           
 double distance(FrameLine2d line)
           
 double distance(FrameLineSegment2d secondLineSegment)
           
 double distance(FramePoint2d point)
           
 double dotProduct(FrameLineSegment2d frameLineSegment2d)
           
 void flipDirection()
           
static FrameLineSegment2d generateRandomFrameLineSegment2d(java.util.Random random, ReferenceFrame zUpFrame, double xMin, double xMax, double yMin, double yMax)
           
 FramePoint2d[] getEndFramePointsCopy()
           
 FramePoint2d getFirstEndPointCopy()
           
 LineSegment2d getLineSegment2d()
           
 LineSegment2d getLineSegment2dCopy()
           
 ReferenceFrame getReferenceFrame()
           
 FramePoint2d getSecondEndPointCopy()
           
 FrameVector2d getVectorCopy()
           
 FramePoint2d[] intersectionWith(FrameConvexPolygon2d convexPolygon)
           
 FramePoint2d intersectionWith(FrameLine2d line)
           
 FramePoint2d intersectionWith(FrameLineSegment2d secondLineSegment)
           
 boolean isBetweenEndpoints(FramePoint2d point2d, double epsilon)
           
 boolean isPointOnLeftSideOfLineSegment(FramePoint2d point)
           
 boolean isPointOnRightSideOfLineSegment(FramePoint2d point)
           
 double length()
           
 FramePoint2d midpoint()
           
 void orthogonalProjection(FramePoint2d point)
           
 FramePoint2d orthogonalProjectionCopy(FramePoint2d point)
           
 double percentageAlongLineSegment(FramePoint2d point2d)
           
 FramePoint2d pointBetweenEndPointsGivenParameter(double parameter)
           
 void set(FrameLineSegment2d lineSegment)
           
 void set(FramePoint2d[] endpoints)
           
 void set(FramePoint2d endpoint0, FramePoint2d endpoint1)
           
 void set(ReferenceFrame referenceFrame, double x0, double y0, double x1, double y1)
           
 FrameLineSegment2d shiftToLeftCopy(double distanceToShift)
           
 FrameLineSegment2d shiftToRightCopy(double distanceToShift)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrameLineSegment2d

public FrameLineSegment2d(ReferenceFrame referenceFrame,
                          LineSegment2d lineSegment2d)

FrameLineSegment2d

public FrameLineSegment2d(ReferenceFrame referenceFrame,
                          javax.vecmath.Point2d[] endpoints)

FrameLineSegment2d

public FrameLineSegment2d(ReferenceFrame referenceFrame,
                          javax.vecmath.Point2d endpoint1,
                          javax.vecmath.Point2d endpoint2)

FrameLineSegment2d

public FrameLineSegment2d(FramePoint2d[] endpoints)

FrameLineSegment2d

public FrameLineSegment2d(FramePoint2d endpoint1,
                          FramePoint2d endpoint2)

FrameLineSegment2d

public FrameLineSegment2d(FrameLineSegment2d frameLineSegment2d)
Method Detail

set

public void set(FramePoint2d endpoint0,
                FramePoint2d endpoint1)

getFirstEndPointCopy

public FramePoint2d getFirstEndPointCopy()

getSecondEndPointCopy

public FramePoint2d getSecondEndPointCopy()

getVectorCopy

public FrameVector2d getVectorCopy()

set

public void set(FramePoint2d[] endpoints)

set

public void set(ReferenceFrame referenceFrame,
                double x0,
                double y0,
                double x1,
                double y1)

set

public void set(FrameLineSegment2d lineSegment)

flipDirection

public void flipDirection()

getLineSegment2d

public LineSegment2d getLineSegment2d()

getLineSegment2dCopy

public LineSegment2d getLineSegment2dCopy()

getEndFramePointsCopy

public FramePoint2d[] getEndFramePointsCopy()

length

public double length()

midpoint

public FramePoint2d midpoint()

dotProduct

public double dotProduct(FrameLineSegment2d frameLineSegment2d)

isBetweenEndpoints

public boolean isBetweenEndpoints(FramePoint2d point2d,
                                  double epsilon)

percentageAlongLineSegment

public double percentageAlongLineSegment(FramePoint2d point2d)

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

changeFrame

public void changeFrame(ReferenceFrame desiredFrame)

changeFrameCopy

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

changeFrame

public void changeFrame(ReferenceFrame desiredFrame,
                        boolean requireTransformInPlane)

changeFrameCopy

public FrameLineSegment2d changeFrameCopy(ReferenceFrame desiredFrame,
                                          boolean requireTransformInPlane)

applyTransformCopy

public FrameLineSegment2d 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:
FrameLineSegment2d

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 line)
Specified by:
intersectionWith in interface FrameGeometry2d

intersectionWith

public FramePoint2d intersectionWith(FrameLineSegment2d secondLineSegment)
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 line)
Specified by:
distance in interface FrameGeometry2d

distance

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

distance

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

isPointOnLeftSideOfLineSegment

public boolean isPointOnLeftSideOfLineSegment(FramePoint2d point)

isPointOnRightSideOfLineSegment

public boolean isPointOnRightSideOfLineSegment(FramePoint2d point)

shiftToLeftCopy

public FrameLineSegment2d shiftToLeftCopy(double distanceToShift)

shiftToRightCopy

public FrameLineSegment2d shiftToRightCopy(double distanceToShift)

pointBetweenEndPointsGivenParameter

public FramePoint2d pointBetweenEndPointsGivenParameter(double parameter)

generateRandomFrameLineSegment2d

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