LongPoint2D

final case class LongPoint2D(x: Long, y: Long) extends LongPoint2DLike
Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

Inherited methods

final def contains(p: LongPoint2DLike): Boolean

Queries the overlap of this shape with a given LongPoint2D p. The point is considered to have a side length of 1!

Queries the overlap of this shape with a given LongPoint2D p. The point is considered to have a side length of 1!

Returns:

true if this shape contains or partly overlaps the given point

Inherited from:
LongPoint2DLike
def distanceSq(that: LongPoint2DLike): BigInt
Inherited from:
LongPoint2DLike
final def left: Long
Inherited from:
LongPoint2DLike
final def orient(b: LongPoint2DLike): Int

Returns the orientation of the given point wrt this point, according to the following scheme:

Returns the orientation of the given point wrt this point, according to the following scheme:

5 4 6 +---+ 1 | 0 | 2 +---+ 9 8 10

Therefore the horizontal orientation can be extracted with _ & 3, and the vertical orientation with _ >> 2, where orientation is 0 for 'parallel', 1 for 'before' and '3' for 'after', so that if the orient is before or after, the sign can be retrieved via _ - 2

For example, if this is LongPoint2D(4, 4) and the query point is LongPoint2D(4, 5), the result is 12. If the query is LongPoint2D(0, 0), the result is 5, etc.

Inherited from:
LongPoint2DLike
def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product
final def top: Long
Inherited from:
LongPoint2DLike