PointKt

Added in 1.1.0

public final class PointKt


Summary

Public methods

static final int

Returns the x coordinate of this point.

static final float

Returns the x coordinate of this point.

static final int

Returns the y coordinate of this point.

static final float

Returns the y coordinate of this point.

static final @NonNull Point
div(@NonNull Point receiver, float scalar)

Divides this point by the specified scalar value and returns the result as a new point.

static final @NonNull PointF
div(@NonNull PointF receiver, float scalar)

Divides this point by the specified scalar value and returns the result as a new point.

static final @NonNull Point
minus(@NonNull Point receiver, @NonNull Point p)

Offsets this point by the negation of the specified point and returns the result as a new point.

static final @NonNull Point
minus(@NonNull Point receiver, int xy)

Offsets this point by the negation of the specified amount on both X and Y axis and returns the result as a new point.

static final @NonNull PointF
minus(@NonNull PointF receiver, @NonNull PointF p)

Offsets this point by the negation of the specified point and returns the result as a new point.

static final @NonNull PointF
minus(@NonNull PointF receiver, float xy)

Offsets this point by the negation of the specified amount on both X and Y axis and returns the result as a new point.

static final @NonNull Point
plus(@NonNull Point receiver, @NonNull Point p)

Offsets this point by the specified point and returns the result as a new point.

static final @NonNull Point
plus(@NonNull Point receiver, int xy)

Offsets this point by the specified amount on both X and Y axis and returns the result as a new point.

static final @NonNull PointF
plus(@NonNull PointF receiver, @NonNull PointF p)

Offsets this point by the specified point and returns the result as a new point.

static final @NonNull PointF
plus(@NonNull PointF receiver, float xy)

Offsets this point by the specified amount on both X and Y axis and returns the result as a new point.

static final @NonNull Point
times(@NonNull Point receiver, float scalar)

Multiplies this point by the specified scalar value and returns the result as a new point.

static final @NonNull PointF
times(@NonNull PointF receiver, float scalar)

Multiplies this point by the specified scalar value and returns the result as a new point.

static final @NonNull Point
toPoint(@NonNull PointF receiver)

Returns a Point representation of this point.

static final @NonNull PointF
toPointF(@NonNull Point receiver)

Returns a PointF representation of this point.

static final @NonNull Point

Returns a new point representing the negation of this point.

static final @NonNull PointF

Returns a new point representing the negation of this point.

Public methods

component1

public static final int component1(@NonNull Point receiver)

Returns the x coordinate of this point.

This method allows to use destructuring declarations when working with points, for example:

val (x, y) = myPoint

component1

public static final float component1(@NonNull PointF receiver)

Returns the x coordinate of this point.

This method allows to use destructuring declarations when working with points, for example:

val (x, y) = myPoint

component2

public static final int component2(@NonNull Point receiver)

Returns the y coordinate of this point.

This method allows to use destructuring declarations when working with points, for example:

val (x, y) = myPoint

component2

public static final float component2(@NonNull PointF receiver)

Returns the y coordinate of this point.

This method allows to use destructuring declarations when working with points, for example:

val (x, y) = myPoint

div

public static final @NonNull Point div(@NonNull Point receiver, float scalar)

Divides this point by the specified scalar value and returns the result as a new point.

div

public static final @NonNull PointF div(@NonNull PointF receiver, float scalar)

Divides this point by the specified scalar value and returns the result as a new point.

minus

public static final @NonNull Point minus(@NonNull Point receiver, @NonNull Point p)

Offsets this point by the negation of the specified point and returns the result as a new point.

minus

public static final @NonNull Point minus(@NonNull Point receiver, int xy)

Offsets this point by the negation of the specified amount on both X and Y axis and returns the result as a new point.

minus

public static final @NonNull PointF minus(@NonNull PointF receiver, @NonNull PointF p)

Offsets this point by the negation of the specified point and returns the result as a new point.

minus

public static final @NonNull PointF minus(@NonNull PointF receiver, float xy)

Offsets this point by the negation of the specified amount on both X and Y axis and returns the result as a new point.

plus

public static final @NonNull Point plus(@NonNull Point receiver, @NonNull Point p)

Offsets this point by the specified point and returns the result as a new point.

plus

public static final @NonNull Point plus(@NonNull Point receiver, int xy)

Offsets this point by the specified amount on both X and Y axis and returns the result as a new point.

plus

public static final @NonNull PointF plus(@NonNull PointF receiver, @NonNull PointF p)

Offsets this point by the specified point and returns the result as a new point.

plus

public static final @NonNull PointF plus(@NonNull PointF receiver, float xy)

Offsets this point by the specified amount on both X and Y axis and returns the result as a new point.

times

public static final @NonNull Point times(@NonNull Point receiver, float scalar)

Multiplies this point by the specified scalar value and returns the result as a new point.

times

public static final @NonNull PointF times(@NonNull PointF receiver, float scalar)

Multiplies this point by the specified scalar value and returns the result as a new point.

toPoint

public static final @NonNull Point toPoint(@NonNull PointF receiver)

Returns a Point representation of this point.

toPointF

public static final @NonNull PointF toPointF(@NonNull Point receiver)

Returns a PointF representation of this point.

unaryMinus

public static final @NonNull Point unaryMinus(@NonNull Point receiver)

Returns a new point representing the negation of this point.

unaryMinus

public static final @NonNull PointF unaryMinus(@NonNull PointF receiver)

Returns a new point representing the negation of this point.