|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.mit.sketch.language.S_UMLLine
public class S_UMLLine
This class is a collection of static methods that are commonly used when doing line computations.
| Constructor Summary | |
|---|---|
S_UMLLine()
|
|
| Method Summary | |
|---|---|
static boolean |
aboveLine(double x,
double y,
double m,
double b,
double error)
Given a line, represented by slope m, and y-intercept b, does a point, represented by x,y, rest above the line by at least a certain amount (the error). |
static boolean |
aboveLine(Line l,
Point p,
double error)
|
static boolean |
aboveLine(Point p,
double m,
double b,
double error)
Given a line, represented by slope m, and y-intercept b, does a point, represented by x,y, rest above the line by at least a certain amount (the error). |
static boolean |
belowLine(double x,
double y,
double m,
double b,
double error)
Given a line, represented by slope m, and y-intercept b, does a point, represented by x,y, fall below the line by at least a certain amount (the error). |
static boolean |
belowLine(Line l,
Point p,
double error)
|
static boolean |
belowLine(Point p,
double m,
double b,
double error)
Given a line, represented by slope m, and y-intercept b, does a point, represented by x,y, fall below the line by at least a certain amount (the error). |
static double |
computeAngle(Point l1p1,
Point l1p2,
Point l2p1,
Point l2p2)
Computes the angles between the two lines |
static int |
countIntersectingStrokes(DrawnShape s1,
DrawnShape s2)
|
static int |
countIntersectingStrokes(Stroke s1,
Stroke s2)
|
static double |
getB(double x,
double y,
double m)
Returns the y-incercept of a line with slope m, passing through point x,y |
static double |
getB(Point p,
double m)
|
static Point |
getIntersectingPoint(Point start1,
Point end1,
Point start2,
Point end2)
Returns intersecting point of two lines (as if the two lines were infinite) Use isIntersecting to check if lines are actually intersecting |
static double |
getSlope(double x1,
double y1,
double x2,
double y2)
Returns the slope of a line given two points on the line. |
static double |
getSlope(Line l)
|
static double |
getSlope(Point p1,
Point p2)
|
static boolean |
isIntersecting(Point start1,
Point end1,
Point start2,
Point end2)
Returns true if the two lines are intersecting |
static boolean |
isIntersectingStrokes(DrawnShape s1,
DrawnShape s2)
|
static boolean |
leftOfLine(double x,
double y,
double m,
double b,
double error)
Given a line, represented by slope m, and y-intercept b, does a point, represented by x,y, fall to the left of the line by at least a certain amount (the error). |
static boolean |
leftOfLine(Line l,
Point p,
double error)
|
static boolean |
leftOfLine(Point p,
double m,
double b,
double error)
Given a line, represented by slope m, and y-intercept b, does a point, represented by x,y, fall to the left of the line by at least a certain amount (the error). |
static boolean |
rightOfLine(double x,
double y,
double m,
double b,
double error)
Given a line, represented by slope m, and y-intercept b, does a point, represented by x,y, fall to the right of the line by at least a certain amount (the error). |
static boolean |
rightOfLine(Line l,
Point p,
double error)
|
static boolean |
rightOfLine(Point p,
double m,
double b,
double error)
Given a line, represented by slope m, and y-intercept b, does a point, represented by x,y, fall to the right of the line by at least a certain amount (the error). |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public S_UMLLine()
| Method Detail |
|---|
public static double getSlope(double x1,
double y1,
double x2,
double y2)
public static double getSlope(Line l)
public static double getSlope(Point p1,
Point p2)
public static double getB(double x,
double y,
double m)
public static double getB(Point p,
double m)
public static boolean aboveLine(Line l,
Point p,
double error)
public static boolean belowLine(Line l,
Point p,
double error)
public static boolean rightOfLine(Line l,
Point p,
double error)
public static boolean leftOfLine(Line l,
Point p,
double error)
public static boolean aboveLine(double x,
double y,
double m,
double b,
double error)
public static boolean aboveLine(Point p,
double m,
double b,
double error)
public static boolean belowLine(double x,
double y,
double m,
double b,
double error)
public static boolean belowLine(Point p,
double m,
double b,
double error)
public static boolean leftOfLine(double x,
double y,
double m,
double b,
double error)
public static boolean leftOfLine(Point p,
double m,
double b,
double error)
public static boolean rightOfLine(double x,
double y,
double m,
double b,
double error)
public static boolean rightOfLine(Point p,
double m,
double b,
double error)
p - the point to be checkedm - the slope of the lineb - the y-intercept of the lineerror - the acceptable error distance
public static Point getIntersectingPoint(Point start1,
Point end1,
Point start2,
Point end2)
public static boolean isIntersecting(Point start1,
Point end1,
Point start2,
Point end2)
public static boolean isIntersectingStrokes(DrawnShape s1,
DrawnShape s2)
public static int countIntersectingStrokes(DrawnShape s1,
DrawnShape s2)
public static int countIntersectingStrokes(Stroke s1,
Stroke s2)
public static double computeAngle(Point l1p1,
Point l1p2,
Point l2p1,
Point l2p2)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||