public class IntPoint extends Point
Point2D.Double, Point2D.Float
Constructor and Description |
---|
IntPoint(int x,
int y)
Creates a point from given coordinates.
|
IntPoint(Point point)
Creates a point from a given integer point.
|
IntPoint(Point2D point) |
Modifier and Type | Method and Description |
---|---|
IntPoint |
add(int addX,
int addY)
Returns a point with this point's coordinates
added with the given coordinates.
|
IntPoint |
add(Point add)
Returns a point with this point's coordinates
added with the given point.
|
IntPoint |
copy()
Creates a new point from a given IntPoint point.
|
IntPoint |
divide(float f) |
boolean |
equals(Object other)
Tests whether this object represents the same point as another
IntPoint
|
float |
length()
Returns the length of this point's vector.
|
IntPoint |
multiply(float mult) |
IntPoint |
multiply(int mult)
Returns a point which is a multiplication of this point.
|
IntPoint |
subtract(int subX,
int subY)
Returns a point with this point's coordinates
subtracted by the given coordinates.
|
IntPoint |
subtract(Point2D sub)
Returns a point with this point's coordinates
subtracted by the given point.
|
String |
toString()
Returns a string representation of this object.
|
Point2D |
unitVector()
Returns the unit vector for this point's vector.
|
void |
unparse(Writer out) |
getLocation, getX, getY, move, setLocation, setLocation, setLocation, translate
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocation
public IntPoint(int x, int y)
public IntPoint(Point point)
public IntPoint(Point2D point)
public IntPoint copy()
public IntPoint subtract(int subX, int subY)
public IntPoint subtract(Point2D sub)
public IntPoint add(int addX, int addY)
public IntPoint add(Point add)
public IntPoint multiply(int mult)
public IntPoint multiply(float mult)
public IntPoint divide(float f)
public float length()
public Point2D unitVector()
public void unparse(Writer out) throws IOException
IOException
public String toString()
Copyright © 2012 Uppsala University and Aalborg University. All Rights Reserved.