us.ihmc.utilities.math.geometry
Class Line2d

java.lang.Object
  extended by us.ihmc.utilities.math.geometry.Line2d
All Implemented Interfaces:
Geometry2d

public class Line2d
extends java.lang.Object
implements Geometry2d

Title:

Description:

Copyright: Copyright (c) 2007

Company:

Version:
1.0
Author:
Twan Koolen

Constructor Summary
Line2d(Line2d line2d)
           
Line2d(javax.vecmath.Point2d firstPointOnLine, javax.vecmath.Point2d secondPointOnLine)
           
Line2d(javax.vecmath.Point2d point, javax.vecmath.Vector2d vector)
           
 
Method Summary
 void applyTransform(javax.media.j3d.Transform3D transform)
           
 void applyTransform(javax.media.j3d.Transform3D transform, boolean requireTransformInPlane)
           
 Line2d applyTransformCopy(javax.media.j3d.Transform3D transform)
           
 Line2d applyTransformCopy(javax.media.j3d.Transform3D transform, boolean requireTransformInPlane)
           
 boolean containsEpsilon(javax.vecmath.Point2d point, double epsilon)
           
 boolean containsNaN()
           
 double distance(ConvexPolygon2d convexPolygon)
           
 double distance(Line2d line)
           
 double distance(LineSegment2d lineSegment)
           
 double distance(javax.vecmath.Point2d point)
           
 double distanceSquared(javax.vecmath.Point2d point)
           
 boolean equals(Line2d otherLine)
           
 javax.vecmath.Vector2d getNormalizedVector()
           
 javax.vecmath.Vector2d getNormalizedVectorCopy()
           
 double getParameterGivenPointEpsilon(javax.vecmath.Point2d point, double epsilon)
           
 javax.vecmath.Point2d getPoint()
           
 javax.vecmath.Point2d getPointCopy()
           
 javax.vecmath.Point2d getPointGivenParameter(double t)
           
 double getSlope()
           
 double getXIntercept()
           
 double getYIntercept()
           
 Line2d interiorBisector(Line2d secondLine)
           
 javax.vecmath.Point2d[] intersectionWith(ConvexPolygon2d convexPolygon)
           
 javax.vecmath.Point2d intersectionWith(Line2d secondLine)
           
 javax.vecmath.Point2d intersectionWith(LineSegment2d lineSegment)
           
 boolean isPointBehindLine(javax.vecmath.Point2d point)
           
 boolean isPointInFrontOfLine(javax.vecmath.Point2d point)
          isPointInFrontOfLine returns whether the point is in front of the line or not.
 boolean isPointOnLeftSideOfLine(javax.vecmath.Point2d point)
           
 boolean isPointOnRightSideOfLine(javax.vecmath.Point2d point)
           
 void negateDirection()
           
 Line2d negateDirectionCopy()
           
 void orthogonalProjection(javax.vecmath.Point2d point2d)
           
 javax.vecmath.Point2d orthogonalProjectionCopy(javax.vecmath.Point2d point)
           
 Line2d perpendicularLineThroughPoint(javax.vecmath.Point2d point)
           
 javax.vecmath.Vector2d perpendicularVector()
           
 void rotate(double radians)
           
 void set(double x0, double y0, double vx, double vy)
           
 void set(Line2d line2d)
           
 void set(javax.vecmath.Point2d[] endpoints)
           
 void set(javax.vecmath.Point2d endpoint0, javax.vecmath.Point2d endpoint1)
           
 void setParallelLineThroughPoint(javax.vecmath.Point2d point)
           
 void setPoint2d(javax.vecmath.Point2d point2d)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Line2d

public Line2d(javax.vecmath.Point2d point,
              javax.vecmath.Vector2d vector)

Line2d

public Line2d(javax.vecmath.Point2d firstPointOnLine,
              javax.vecmath.Point2d secondPointOnLine)

Line2d

public Line2d(Line2d line2d)
Method Detail

getPoint

public javax.vecmath.Point2d getPoint()

getPointCopy

public javax.vecmath.Point2d getPointCopy()

getNormalizedVector

public javax.vecmath.Vector2d getNormalizedVector()

getNormalizedVectorCopy

public javax.vecmath.Vector2d getNormalizedVectorCopy()

getSlope

public double getSlope()

getPointGivenParameter

public javax.vecmath.Point2d getPointGivenParameter(double t)

getParameterGivenPointEpsilon

public double getParameterGivenPointEpsilon(javax.vecmath.Point2d point,
                                            double epsilon)

getXIntercept

public double getXIntercept()

getYIntercept

public double getYIntercept()

containsEpsilon

public boolean containsEpsilon(javax.vecmath.Point2d point,
                               double epsilon)

negateDirection

public void negateDirection()

negateDirectionCopy

public Line2d negateDirectionCopy()

setPoint2d

public void setPoint2d(javax.vecmath.Point2d point2d)

set

public void set(javax.vecmath.Point2d endpoint0,
                javax.vecmath.Point2d endpoint1)

set

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

set

public void set(javax.vecmath.Point2d[] endpoints)

set

public void set(Line2d line2d)

rotate

public void rotate(double radians)

interiorBisector

public Line2d interiorBisector(Line2d secondLine)

perpendicularVector

public javax.vecmath.Vector2d perpendicularVector()

perpendicularLineThroughPoint

public Line2d perpendicularLineThroughPoint(javax.vecmath.Point2d point)

intersectionWith

public javax.vecmath.Point2d intersectionWith(LineSegment2d lineSegment)
Specified by:
intersectionWith in interface Geometry2d

intersectionWith

public javax.vecmath.Point2d intersectionWith(Line2d secondLine)
Specified by:
intersectionWith in interface Geometry2d

intersectionWith

public javax.vecmath.Point2d[] intersectionWith(ConvexPolygon2d convexPolygon)
Specified by:
intersectionWith in interface Geometry2d

distance

public double distance(javax.vecmath.Point2d point)
Specified by:
distance in interface Geometry2d

distanceSquared

public double distanceSquared(javax.vecmath.Point2d point)

distance

public double distance(Line2d line)
Specified by:
distance in interface Geometry2d

distance

public double distance(LineSegment2d lineSegment)
Specified by:
distance in interface Geometry2d

distance

public double distance(ConvexPolygon2d convexPolygon)
Specified by:
distance in interface Geometry2d

toString

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

applyTransform

public void applyTransform(javax.media.j3d.Transform3D transform)
Specified by:
applyTransform in interface Geometry2d

applyTransform

public void applyTransform(javax.media.j3d.Transform3D transform,
                           boolean requireTransformInPlane)
Specified by:
applyTransform in interface Geometry2d

applyTransformCopy

public Line2d applyTransformCopy(javax.media.j3d.Transform3D transform)
Specified by:
applyTransformCopy in interface Geometry2d

applyTransformCopy

public Line2d applyTransformCopy(javax.media.j3d.Transform3D transform,
                                 boolean requireTransformInPlane)
Specified by:
applyTransformCopy in interface Geometry2d

isPointOnLeftSideOfLine

public boolean isPointOnLeftSideOfLine(javax.vecmath.Point2d point)

isPointOnRightSideOfLine

public boolean isPointOnRightSideOfLine(javax.vecmath.Point2d point)

isPointInFrontOfLine

public boolean isPointInFrontOfLine(javax.vecmath.Point2d 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 - Point2d
Returns:
boolean

isPointBehindLine

public boolean isPointBehindLine(javax.vecmath.Point2d point)

setParallelLineThroughPoint

public void setParallelLineThroughPoint(javax.vecmath.Point2d point)

containsNaN

public boolean containsNaN()

orthogonalProjection

public void orthogonalProjection(javax.vecmath.Point2d point2d)
Specified by:
orthogonalProjection in interface Geometry2d

orthogonalProjectionCopy

public javax.vecmath.Point2d orthogonalProjectionCopy(javax.vecmath.Point2d point)
Specified by:
orthogonalProjectionCopy in interface Geometry2d

equals

public boolean equals(Line2d otherLine)