# Class Location

java.lang.Object
com.sparshui.common.Location

All Implemented Interfaces:
  `Serializable`

public class Location extends Object implements Serializable
Represents a 2D location with float values.

Author:
  Jay Roltgen
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`Location()`
Cosntruct a default location.
`Location(float x, float y)`
Construct a specific location.

## Method Summary

Modifier and Type
Method
Description
`static Location`
`getCenter(Location a, Location b)`
`static Location`
`getCentroid(Location a, Location b, float w)`
get weighted average location.
`float`
`getDistance(Location location)`
`V3`
`getVector(Location location)`
`float`
`getX()`
`float`
`getY()`
`static Location`
`pixelLocation(Location location)`
`static Location`
`screenLocation(Location location)`
`String`
`toString()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## 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

public String toString()

Overrides:
  `toString` in class `Object`

### getDistance

public float getDistance(Location location)

### getVector

public V3 getVector(Location location)

### getCenter

public static Location getCenter(Location a, Location b)

### getCentroid

public static Location getCentroid(Location a, Location b, float w)
get weighted average location. w = 0 --> all a; w = 1 --> all b

Parameters:
  `a` -
  `b` -
  `w` -
Returns:
  Location

### pixelLocation

public static Location pixelLocation(Location location)

### screenLocation

public static Location screenLocation(Location location)