Package breadboards
Class GPoint
- java.lang.Object
-
- breadboards.GPoint
-
public class GPoint extends java.lang.Object
Class whose objects are coordinates (x,y) where these coordinates are stored as doubles- Author:
- paul oser
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getX()
returns the GPoint's x-coordinatedouble
getY()
returns the GPoint's y-coordinatevoid
setLocation(double x, double y)
sets the location of the GPoint to the specified locationvoid
translate(double dx, double dy)
translates the GPoint dx units to the right (left if negative) and dy units down (up if negative)
-
-
-
Method Detail
-
getX
public double getX()
returns the GPoint's x-coordinate- Returns:
- the GPoint's x-coordinate
-
getY
public double getY()
returns the GPoint's y-coordinate- Returns:
- the GPoint's y-coordinate
-
setLocation
public void setLocation(double x, double y)
sets the location of the GPoint to the specified location- Parameters:
x
- the specified x-coordinatey
- the specified y-coordinate
-
translate
public void translate(double dx, double dy)
translates the GPoint dx units to the right (left if negative) and dy units down (up if negative)- Parameters:
dx
- distance to move GPoint to the right (left if negative)dy
- distance to move GPoint down (up if negative)
-
-