edu.mit.sketch.uml
Class S_UMLPoint

java.lang.Object
  |
  +--edu.mit.sketch.uml.S_UMLPoint

public class S_UMLPoint
extends Object

This class is a collection of static methods that are commonly used when doing point computations. The S in front of the class name implies that all methods are static.


Constructor Summary
S_UMLPoint()
           
 
Method Summary
static boolean close(Point start, Point end)
          Returns true if within default distance 10
static boolean close(Point start, Point end, double d)
          Returns true if within distance d
static double distance(double x1, double y1, double x2, double y2)
          Returns the distance between two points
static double distance(int x1, int y1, int x2, int y2)
          Returns the distance between two points
static double distance(Point p1, Point p2)
          Returns the distance between two points
static Point rotatePoint(Point p, double angle)
          Returns the point rotated by an angle
static Point shiftPoint(Point p, int shift_x, int shift_y)
          Returns the point horizontally by shift_x and vertically by shift_y
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

S_UMLPoint

public S_UMLPoint()
Method Detail

distance

public static double distance(double x1,
                              double y1,
                              double x2,
                              double y2)
Returns the distance between two points

distance

public static double distance(Point p1,
                              Point p2)
Returns the distance between two points

distance

public static double distance(int x1,
                              int y1,
                              int x2,
                              int y2)
Returns the distance between two points

rotatePoint

public static Point rotatePoint(Point p,
                                double angle)
Returns the point rotated by an angle

shiftPoint

public static Point shiftPoint(Point p,
                               int shift_x,
                               int shift_y)
Returns the point horizontally by shift_x and vertically by shift_y

close

public static boolean close(Point start,
                            Point end)
Returns true if within default distance 10

close

public static boolean close(Point start,
                            Point end,
                            double d)
Returns true if within distance d