us.ihmc.utilities.math.geometry
Class Geometry2dCalculator

java.lang.Object
  extended by us.ihmc.utilities.math.geometry.Geometry2dCalculator

public class Geometry2dCalculator
extends java.lang.Object

Title:

Description:

Copyright: Copyright (c) 2007

Company:

Version:
1.0
Author:
not attributable

Constructor Summary
Geometry2dCalculator()
           
 
Method Summary
static double distance(ConvexPolygon2d firstConvexPolygon, ConvexPolygon2d secondConvexPolygon)
           
static double distance(Line2d line, ConvexPolygon2d convexPolygon)
           
static double distance(Line2d firstLine, Line2d secondLine)
           
static double distance(Line2d line, LineSegment2d lineSegment)
           
static double distance(LineSegment2d lineSegment, ConvexPolygon2d convexPolygon)
           
static double distance(LineSegment2d firstLineSegment, LineSegment2d secondLineSegment)
           
static double distance(javax.vecmath.Point2d point, ConvexPolygon2d convexPolygon)
           
static double distance(javax.vecmath.Point2d point, Line2d line)
           
static double distance(javax.vecmath.Point2d point, LineSegment2d lineSegment)
           
static double distanceSquared(javax.vecmath.Point2d point, Line2d line)
           
static double[] intersection(double firstPointX, double firstPointY, double firstVectorX, double firstVectorY, double secondPointX, double secondPointY, double secondVectorX, double secondVectorY)
          Finds the intersection parameters between two lines.
static javax.vecmath.Point2d[] intersection(Line2d line, ConvexPolygon2d convexPolygon)
           
static javax.vecmath.Point2d intersection(Line2d firstLine, Line2d secondLine)
           
static javax.vecmath.Point2d intersection(Line2d line2d, LineSegment2d lineSegment)
           
static javax.vecmath.Point2d[] intersection(LineSegment2d lineSegment, ConvexPolygon2d convexPolygon)
           
static javax.vecmath.Point2d intersection(LineSegment2d firstLineSegment2d, LineSegment2d secondLineSegment2d)
           
static void orthogonalProjection(javax.vecmath.Point2d point2d, ConvexPolygon2d convexPolygon)
           
static void orthogonalProjection(javax.vecmath.Point2d point2d, Line2d line2d)
           
static void orthogonalProjection(javax.vecmath.Point2d point2d, LineSegment2d lineSegment)
           
static javax.vecmath.Point2d orthogonalProjectionCopy(javax.vecmath.Point2d point, ConvexPolygon2d convexPolygon)
           
static javax.vecmath.Point2d orthogonalProjectionCopy(javax.vecmath.Point2d point, Line2d line)
           
static javax.vecmath.Point2d orthogonalProjectionCopy(javax.vecmath.Point2d point, LineSegment2d lineSegment)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Geometry2dCalculator

public Geometry2dCalculator()
Method Detail

intersection

public static double[] intersection(double firstPointX,
                                    double firstPointY,
                                    double firstVectorX,
                                    double firstVectorY,
                                    double secondPointX,
                                    double secondPointY,
                                    double secondVectorX,
                                    double secondVectorY)
Finds the intersection parameters between two lines. First line starts at (firstPointX, firstPointY) and has direction vector (firstVectorX, firstVectorY). The second line starts at (secondPointX, secondPointY) and has direction vector (secondVectorX, secondVectorY). Returns null if the lines are parallel. Returns {alpha, beta} such that the intersection between the lines occurs at P1 + alpha * V1 = P2 + beta * V2;

Parameters:
firstPointX - double First line starting x.
firstPointY - double First line starting y.
firstVectorX - double First line direction x.
firstVectorY - double First line direction y.
secondPointX - double Second line starting x.
secondPointY - double Second line starting y.
secondVectorX - double Second line direction x.
secondVectorY - double Second line direction y.
Returns:
double[] {alpha, beta} such that the intersection between the lines occurs at P1 + alpha * V1 = P2 + beta * V2;

intersection

public static javax.vecmath.Point2d intersection(Line2d firstLine,
                                                 Line2d secondLine)

intersection

public static javax.vecmath.Point2d intersection(Line2d line2d,
                                                 LineSegment2d lineSegment)

intersection

public static javax.vecmath.Point2d intersection(LineSegment2d firstLineSegment2d,
                                                 LineSegment2d secondLineSegment2d)

intersection

public static javax.vecmath.Point2d[] intersection(Line2d line,
                                                   ConvexPolygon2d convexPolygon)

intersection

public static javax.vecmath.Point2d[] intersection(LineSegment2d lineSegment,
                                                   ConvexPolygon2d convexPolygon)

orthogonalProjection

public static void orthogonalProjection(javax.vecmath.Point2d point2d,
                                        Line2d line2d)

orthogonalProjection

public static void orthogonalProjection(javax.vecmath.Point2d point2d,
                                        ConvexPolygon2d convexPolygon)

orthogonalProjection

public static void orthogonalProjection(javax.vecmath.Point2d point2d,
                                        LineSegment2d lineSegment)

orthogonalProjectionCopy

public static javax.vecmath.Point2d orthogonalProjectionCopy(javax.vecmath.Point2d point,
                                                             LineSegment2d lineSegment)

orthogonalProjectionCopy

public static javax.vecmath.Point2d orthogonalProjectionCopy(javax.vecmath.Point2d point,
                                                             Line2d line)

orthogonalProjectionCopy

public static javax.vecmath.Point2d orthogonalProjectionCopy(javax.vecmath.Point2d point,
                                                             ConvexPolygon2d convexPolygon)

distance

public static double distance(javax.vecmath.Point2d point,
                              Line2d line)

distanceSquared

public static double distanceSquared(javax.vecmath.Point2d point,
                                     Line2d line)

distance

public static double distance(javax.vecmath.Point2d point,
                              LineSegment2d lineSegment)

distance

public static double distance(javax.vecmath.Point2d point,
                              ConvexPolygon2d convexPolygon)

distance

public static double distance(Line2d firstLine,
                              Line2d secondLine)

distance

public static double distance(Line2d line,
                              LineSegment2d lineSegment)

distance

public static double distance(Line2d line,
                              ConvexPolygon2d convexPolygon)

distance

public static double distance(LineSegment2d firstLineSegment,
                              LineSegment2d secondLineSegment)

distance

public static double distance(LineSegment2d lineSegment,
                              ConvexPolygon2d convexPolygon)

distance

public static double distance(ConvexPolygon2d firstConvexPolygon,
                              ConvexPolygon2d secondConvexPolygon)