|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--edu.mit.sketch.geom.GeometryUtil
Implements geometry related utility functions
| Constructor Summary | |
GeometryUtil()
|
|
| Method Summary | |
static void |
continualizeDirection(double[] direction)
This is for making the Math.pi/2, -Math.pi/2 transitions continuous. |
static double |
cosTheoremAngle(Point a,
Point b,
Point c)
Return angle between |AB| and |BC| |
static double |
degree2radian(double angle)
degree2radian |
static double |
distance(Point p1,
Point p2)
Return distnace |p1-p2| |
static boolean |
equalDoubles(double a,
double b,
double tolerance)
Return true if |a-b| < tolerance |
static double[] |
getIntermediateAngles(Vertex[] input_vertices)
Find the angles that the intermediate line segments make WRT the x axis using the input_vertices |
static boolean |
linesParallel(Line a,
Line b,
double t)
Return true if two lines are roughly parallel Tolerance is the tolerance in the difference of slopes. |
static boolean |
parallelAngles(double angle_a,
double angle_b,
double t)
Return true if two lines with angles a and b are roughly parallel within the tolerance t. |
static double |
ptSegDist(Point p1,
Point p2,
Point p)
A different version of ptSegDist |
static double |
ptSegDistSq(double X1,
double Y1,
double X2,
double Y2,
double PX,
double PY)
From Sun's java.awt.geom.Line2D.java Returns the square of the distance from a point to a line segment. |
static double |
ptSegDistSq(Point p1,
Point p2,
Point p)
A different version of ptSegDistSq |
static double |
radian2degree(double angle)
radian2degree |
static int |
relativeCCW(double X1,
double Y1,
double X2,
double Y2,
double PX,
double PY)
From Sun's java.awt.geom.Line2D.java Returns an indicator of where the specified point (PX, PY) lies with respect to the line segment from (X1, Y1) to (X2, Y2). |
static int |
relativeCCW(Point x1,
Point x2,
Point p)
A different version of relativeCCW |
static double[] |
roundAngles(double[] angles,
double dx)
return a double array which is the same length as the input array, except the array entries are rounded up or down to be integral multiples of dx. |
static double |
segmentLength(Point[] points,
int begin_index,
int end_index)
Return the segment length from index begin_index to end_index in points (end_index included). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GeometryUtil()
| Method Detail |
public static double[] roundAngles(double[] angles,
double dx)
public static boolean equalDoubles(double a,
double b,
double tolerance)
public static boolean linesParallel(Line a,
Line b,
double t)
public static boolean parallelAngles(double angle_a,
double angle_b,
double t)
public static double radian2degree(double angle)
public static double degree2radian(double angle)
public static double distance(Point p1,
Point p2)
public static double cosTheoremAngle(Point a,
Point b,
Point c)
public static double ptSegDist(Point p1,
Point p2,
Point p)
public static double ptSegDistSq(Point p1,
Point p2,
Point p)
public static double ptSegDistSq(double X1,
double Y1,
double X2,
double Y2,
double PX,
double PY)
X1, Y1 - the coordinates of the beginning of the
specified line segmentX2, Y2 - the coordinates of the end of the specified
line segmentPX, PY - the coordinates of the specified point being
measured
public static int relativeCCW(Point x1,
Point x2,
Point p)
public static int relativeCCW(double X1,
double Y1,
double X2,
double Y2,
double PX,
double PY)
X1, Y1 - the coordinates of the beginning of the
specified line segmentX2, Y2 - the coordinates of the end of the specified
line segmentPX, PY - the coordinates of the specified point to be
compared with the specified line segmentpublic static double[] getIntermediateAngles(Vertex[] input_vertices)
public static void continualizeDirection(double[] direction)
public static double segmentLength(Point[] points,
int begin_index,
int end_index)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||