Point2D

case class Point2D(x: Int, y: Int)

Model a Point in a 2D Space.

Value parameters:
x

the x coordinate

y

the Y coordinate

Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

@targetName("product")
def *: Point2D
Extension method from Space

Product operator.

Product operator.

Value parameters:
other

the other point involved in the operation

Returns:

the multiplication of the two points.

@targetName("plus")
def +: Point2D
Extension method from Space

Plus operator.

Plus operator.

Value parameters:
other

the other point to sum with

Returns:

the sum of the two points.

@targetName("minus")
def -: Point2D
Extension method from Space

Minus operator.

Minus operator.

Value parameters:
other

the other point involved in the operation

Returns:

the difference of the two points

Extension method from Space

General method to combine two Point2D.

General method to combine two Point2D.

Value parameters:
f

the function applied to both the coordinate of the point

other

the other point to combine with

Extension method from Space

Get the distance between the current and the provided point.

Get the distance between the current and the provided point.

Value parameters:
other

the point to witch compute the distance

Returns:

the distance from the point.

Inherited methods

def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product