Class Location
java.lang.Object
com.sparshui.common.Location
- All Implemented Interfaces:
Serializable
Represents a 2D location with float values.
- Author:
- Jay Roltgen
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Locationstatic LocationgetCentroid(Location a, Location b, float w) get weighted average location.floatgetDistance(Location location) floatgetX()floatgetY()static LocationpixelLocation(Location location) static LocationscreenLocation(Location location) toString()
-
Constructor Details
-
Location
public Location()Cosntruct a default location. Values are initialized as the coordinates (0, 0). -
Location
public Location(float x, float y) Construct a specific location.- Parameters:
x- The x coordinate value of the location.y- The y coordinate value of the location.
-
-
Method Details
-
getX
public float getX()- Returns:
- The x coordinate value.
-
getY
public float getY()- Returns:
- The y coordinate value.
-
toString
-
getDistance
-
getVector
-
getCenter
-
getCentroid
-
pixelLocation
-
screenLocation
-