|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectus.ihmc.utilities.math.geometry.GeometryTools
public class GeometryTools
| Constructor Summary | |
|---|---|
GeometryTools()
|
|
| Method Summary | |
|---|---|
static javax.vecmath.Point2d |
averagePoints(java.util.ArrayList<javax.vecmath.Point2d> points)
Averages the 2D points in a given Array |
static javax.vecmath.Point3d |
averagePoints(java.util.ArrayList<javax.vecmath.Point3d> points)
Averages the 3D points in an Array |
static javax.vecmath.Point3d |
averagePoints(javax.vecmath.Point3d a,
javax.vecmath.Point3d b)
Returns the average of two 3D points |
static javax.media.j3d.BranchGroup |
createCube(javax.vecmath.Vector3f thisColor,
javax.vecmath.Point3d position,
double size)
Creates a Cube given size, color, and postion |
static double |
distanceBetweenPoints(double[] a,
double[] b)
Calculates distance between two Double points, a and b. |
static double |
distanceFromPointToLine(javax.vecmath.Point2d point,
javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd)
Returns the minimum distance between a 2D point and an infinitely long 2D line defined by a given line segment. |
static double |
distanceFromPointToLine(javax.vecmath.Point3d point,
javax.vecmath.Point3d lineStart,
javax.vecmath.Point3d lineEnd)
Compute the distance from a point to a line (defined by two 3D points). |
static double |
distanceFromPointToLineSegment(javax.vecmath.Point2d point,
javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd)
Returns the minimum distance between a point and a given line segment. |
static boolean |
doLineSegmentsIntersect(javax.vecmath.Point2d lineStart1,
javax.vecmath.Point2d lineEnd1,
javax.vecmath.Point2d lineStart2,
javax.vecmath.Point2d lineEnd2)
|
static double |
getAngleFromFirstToSecondVector(javax.vecmath.Vector2d firstVector,
javax.vecmath.Vector2d secondVector)
|
static void |
getClosestPointsForTwoLines(FramePoint point1,
FrameVector vector1,
FramePoint point2,
FrameVector vector2,
FramePoint pointOnLine1,
FramePoint pointOnLine2)
|
static javax.vecmath.Point2d |
getClosestPointToLineSegment(javax.vecmath.Point2d testPoint,
javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd)
Let the test point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). |
static FramePoint |
getIntersectionBetweenLineAndPlane(FramePoint pointOnPlane,
FrameVector planeNormal,
FramePoint lineStart,
FramePoint lineEnd)
Locates and returns the intersection between the given line and plane |
static javax.vecmath.Point2d |
getIntersectionBetweenTwoLines(javax.vecmath.Point2d lineStart1,
javax.vecmath.Point2d lineEnd1,
javax.vecmath.Point2d lineStart2,
javax.vecmath.Point2d lineEnd2)
|
static javax.vecmath.Point2d |
getIntersectionBetweenTwoLines(javax.vecmath.Point2d point1,
javax.vecmath.Vector2d vector1,
javax.vecmath.Point2d point2,
javax.vecmath.Vector2d vector2)
Finds the intersection between two 2D lines. |
static double[] |
getLineSegmentPercentagesIfIntersecting(javax.vecmath.Point2d lineStart1,
javax.vecmath.Point2d lineEnd1,
javax.vecmath.Point2d lineStart2,
javax.vecmath.Point2d lineEnd2)
Returns the line segment percentages of the intersection point between two lines if the lines are intersecting and not colinear. |
static javax.vecmath.Vector3d |
getNormalToPlane(javax.vecmath.Point3d a,
javax.vecmath.Point3d b,
javax.vecmath.Point3d c)
Returns the normal of a Plane specified by three points If 2 or more points are the same, returns NaN |
static javax.vecmath.Point2d |
getOrthogonalProjectionOnLine(javax.vecmath.Point2d testPoint,
javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd)
|
static void |
getPerpendicularBisector(javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd,
javax.vecmath.Point2d bisectorStart,
javax.vecmath.Vector2d bisectorDirection)
|
static javax.vecmath.Vector2d |
getPerpendicularVector(javax.vecmath.Vector2d vector)
|
static FrameVector |
getPerpendicularVectorFromLineToPoint(FramePoint point,
FramePoint lineStart,
FramePoint lineEnd,
FramePoint intersectionPoint)
Returns the Perpendicular Vector that is formed between a given Line (defined by two points) and a given point Returns zeros if point is located on the line |
static FrameVector |
getPlaneNormalGivenThreePoints(FramePoint point1,
FramePoint point2,
FramePoint point3)
Returns the Normal of a plane that is defined by three points Returns a null if three points are linear, colinear, or equal Returns a null if two points are the same |
static javax.vecmath.Vector3d |
getPlaneNormalGivenThreePoints(javax.vecmath.Point3d point1,
javax.vecmath.Point3d point2,
javax.vecmath.Point3d point3)
Converts three 3D points into 3 framePoints (defines a plane) Calls getPlaneNormalGivenThreePoints Returns normal to plane Returns null if three points are: linear colinear equal if 2 points are equal |
static Orientation |
getTransform(FramePoint point,
FrameVector normal)
|
static javax.vecmath.Point2d |
getTriangleBisector(javax.vecmath.Point2d A,
javax.vecmath.Point2d B,
javax.vecmath.Point2d C)
This method returns the point representing where the bisector of an angle of a triangle intersects the opposite side. |
static java.util.ArrayList<javax.vecmath.Point3d> |
getVerticalSpansOfPoints(double xMin,
double yMin,
double zMin,
double xMax,
double yMax,
double zMax,
double xResolution,
double yResolution,
double zResolution)
|
static double |
getXYDistance(FramePoint point1,
FramePoint point2)
|
static double |
getXYDistance(javax.vecmath.Point3d point1,
javax.vecmath.Point3d point2)
|
static void |
getZPlanePerpendicularBisector(FramePoint lineStart,
FramePoint lineEnd,
FramePoint bisectorStart,
FrameVector bisectorDirection)
|
static boolean |
isInsidePolygon(javax.vecmath.Point2d p,
java.util.ArrayList<javax.vecmath.Point2d> polygon)
|
static boolean |
isInsidePolygon(javax.vecmath.Point2d point,
javax.vecmath.Point2d[] orderedPolygonPoints)
Checks to make sure a point lies on the same side of the line for all lines going around a polygon; if true, then the point is inside the polygon. |
static boolean |
isInsidePolygon2(javax.vecmath.Point2d p,
javax.vecmath.Point2d[] polygon)
|
static boolean |
isPointOnLeftSideOfLine(FramePoint point,
FramePoint lineStart,
FramePoint lineEnd)
Returns a Boolean value stating whether a point is on the left side of a given line |
static boolean |
isPointOnLeftSideOfLine(javax.vecmath.Point2d point,
javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd)
Returns a boolean value, stating whether a 2D point is on the left side of a given line "Left side" is determined based on order of lineStart and lineEnd returns false if point is on line |
static void |
main(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GeometryTools()
| Method Detail |
|---|
public static double distanceFromPointToLine(javax.vecmath.Point3d point,
javax.vecmath.Point3d lineStart,
javax.vecmath.Point3d lineEnd)
point - Point3dlineStart - Point3dlineEnd - Point3d
public static double distanceFromPointToLine(javax.vecmath.Point2d point,
javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd)
point - Point2dlineStart - Point2dlineEnd - Point2d
public static double distanceFromPointToLineSegment(javax.vecmath.Point2d point,
javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd)
point - Point2dlineStart - Point2dlineEnd - Point2d
public static boolean isPointOnLeftSideOfLine(javax.vecmath.Point2d point,
javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd)
point - Point2dlineStart - Point2dlineEnd - Point2d
public static boolean isPointOnLeftSideOfLine(FramePoint point,
FramePoint lineStart,
FramePoint lineEnd)
point - FramePointlineStart - FramePointlineEnd - FramePoint
public static javax.vecmath.Point2d averagePoints(java.util.ArrayList<javax.vecmath.Point2d> points)
points - ArrayList
public static javax.vecmath.Point3d averagePoints(java.util.ArrayList<javax.vecmath.Point3d> points)
points - ArrayList
public static javax.vecmath.Point3d averagePoints(javax.vecmath.Point3d a,
javax.vecmath.Point3d b)
a - Point3db - Point3d
public static boolean isInsidePolygon(javax.vecmath.Point2d point,
javax.vecmath.Point2d[] orderedPolygonPoints)
point - Point2dorderedPolygonPoints - Point2d[]
public static boolean isInsidePolygon2(javax.vecmath.Point2d p,
javax.vecmath.Point2d[] polygon)
p - Point2dpolygon - Point2d[]
public static boolean isInsidePolygon(javax.vecmath.Point2d p,
java.util.ArrayList<javax.vecmath.Point2d> polygon)
public static javax.vecmath.Point2d getOrthogonalProjectionOnLine(javax.vecmath.Point2d testPoint,
javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd)
public static void getClosestPointsForTwoLines(FramePoint point1,
FrameVector vector1,
FramePoint point2,
FrameVector vector2,
FramePoint pointOnLine1,
FramePoint pointOnLine2)
point1 - FramePointvector1 - FrameVectorpoint2 - FramePointvector2 - FrameVectorpointOnLine1 - FramePointpointOnLine2 - FramePoint
public static FramePoint getIntersectionBetweenLineAndPlane(FramePoint pointOnPlane,
FrameVector planeNormal,
FramePoint lineStart,
FramePoint lineEnd)
pointOnPlane - FramePointplaneNormal - FrameVectorlineStart - FramePointlineEnd - FramePoint
public static boolean doLineSegmentsIntersect(javax.vecmath.Point2d lineStart1,
javax.vecmath.Point2d lineEnd1,
javax.vecmath.Point2d lineStart2,
javax.vecmath.Point2d lineEnd2)
public static javax.vecmath.Point2d getIntersectionBetweenTwoLines(javax.vecmath.Point2d lineStart1,
javax.vecmath.Point2d lineEnd1,
javax.vecmath.Point2d lineStart2,
javax.vecmath.Point2d lineEnd2)
public static javax.vecmath.Point2d getIntersectionBetweenTwoLines(javax.vecmath.Point2d point1,
javax.vecmath.Vector2d vector1,
javax.vecmath.Point2d point2,
javax.vecmath.Vector2d vector2)
point1 - Start Point of first line.vector1 - Direction Vector of first line.point2 - Start Point of second line.vector2 - Direction Vector of second line.
public static double[] getLineSegmentPercentagesIfIntersecting(javax.vecmath.Point2d lineStart1,
javax.vecmath.Point2d lineEnd1,
javax.vecmath.Point2d lineStart2,
javax.vecmath.Point2d lineEnd2)
lineStart1 - Point2dlineEnd1 - Point2dlineStart2 - Point2dlineEnd2 - Point2d
public static FrameVector getPlaneNormalGivenThreePoints(FramePoint point1,
FramePoint point2,
FramePoint point3)
point1 - FramePointpoint2 - FramePointpoint3 - FramePoint
public static FrameVector getPerpendicularVectorFromLineToPoint(FramePoint point,
FramePoint lineStart,
FramePoint lineEnd,
FramePoint intersectionPoint)
point - FramePointlineStart - FramePointlineEnd - FramePointintersectionPoint - FramePoint
public static javax.vecmath.Vector2d getPerpendicularVector(javax.vecmath.Vector2d vector)
public static javax.vecmath.Vector3d getPlaneNormalGivenThreePoints(javax.vecmath.Point3d point1,
javax.vecmath.Point3d point2,
javax.vecmath.Point3d point3)
point1 - Point3dpoint2 - Point3dpoint3 - Point3d
public static void getZPlanePerpendicularBisector(FramePoint lineStart,
FramePoint lineEnd,
FramePoint bisectorStart,
FrameVector bisectorDirection)
public static void getPerpendicularBisector(javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd,
javax.vecmath.Point2d bisectorStart,
javax.vecmath.Vector2d bisectorDirection)
lineStart - Point2dlineEnd - Point2dbisectorStart - Point2dbisectorDirection - Vector2d
public static Orientation getTransform(FramePoint point,
FrameVector normal)
public static javax.vecmath.Point2d getTriangleBisector(javax.vecmath.Point2d A,
javax.vecmath.Point2d B,
javax.vecmath.Point2d C)
A - Point2dB - Point2dC - Point2d
public static double getAngleFromFirstToSecondVector(javax.vecmath.Vector2d firstVector,
javax.vecmath.Vector2d secondVector)
public static javax.media.j3d.BranchGroup createCube(javax.vecmath.Vector3f thisColor,
javax.vecmath.Point3d position,
double size)
thisColor - Vector3fposition - Point3dsize - double
public static double distanceBetweenPoints(double[] a,
double[] b)
a - double[]b - double[]
public static javax.vecmath.Point2d getClosestPointToLineSegment(javax.vecmath.Point2d testPoint,
javax.vecmath.Point2d lineStart,
javax.vecmath.Point2d lineEnd)
public static double getXYDistance(FramePoint point1,
FramePoint point2)
public static double getXYDistance(javax.vecmath.Point3d point1,
javax.vecmath.Point3d point2)
public static java.util.ArrayList<javax.vecmath.Point3d> getVerticalSpansOfPoints(double xMin,
double yMin,
double zMin,
double xMax,
double yMax,
double zMax,
double xResolution,
double yResolution,
double zResolution)
xMin - doubleyMin - doublezMin - doublexMax - doubleyMax - doublezMax - doublexResolution - doubleyResolution - doublezResolution - double
public static javax.vecmath.Vector3d getNormalToPlane(javax.vecmath.Point3d a,
javax.vecmath.Point3d b,
javax.vecmath.Point3d c)
a - Point3db - Point3dc - Point3d
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||