Coordinate

open class Coordinate(xCoord: Number = 0, yCoord: Number = 0)

A Coordinate containing xCoord and yCoord.

Parameters

xCoord

The x coordinate.

yCoord

The y coordinate.

Constructors

Link copied to clipboard
fun Coordinate(xCoord: Number = 0, yCoord: Number = 0)

Creates a Coordinate with given xCoord and yCoord.

Functions

Link copied to clipboard
operator fun div(denominator: Number): Coordinate

Returns a new coordinate object containing divided Coordinate by denominator.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compares coordinate to another Object.

Link copied to clipboard
open override fun hashCode(): Int

HashCode for this object.

Link copied to clipboard
operator fun minus(other: Coordinate): Coordinate

Returns a new coordinate object containing subtracted xCoord and yCoord.

Link copied to clipboard
operator fun plus(other: Coordinate): Coordinate

Returns a new coordinate object containing added xCoord and yCoord.

Link copied to clipboard
fun rotated(angle: Double): Coordinate

Rotates coordinate by angle degrees around point (0,0).

fun rotated(angle: Number, center: Coordinate): Coordinate

Rotates Coordinate by angle degrees around center point.

Link copied to clipboard
operator fun times(factor: Number): Coordinate

Returns a new coordinate object containing multiplied Coordinate with factor.

Link copied to clipboard
open override fun toString(): String

Prints xCoord and yCoord as String.

Properties

Link copied to clipboard
val xCoord: Double

X coordinate.

Link copied to clipboard
val yCoord: Double

Y coordinate.