Represents a position in a 2D coordinate system.
Value parameters
- x
-
The x-coordinate of the position.
- y
-
The y-coordinate of the position.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Finds the center position between this position and another.
Finds the center position between this position and another.
Value parameters
- destination
-
The other position to find the center between.
Attributes
- Returns
-
The center position between this and the destination position.
Moves this position by specified offsets.
Moves this position by specified offsets.
Value parameters
- xOffset
-
The offset in the x-direction.
- yOffset
-
The offset in the y-direction.
Attributes
- Returns
-
A new position after the move.
Rotates the position around a specified center of rotation by a given angle in degrees. Supports direct rotation by 0, 90, 180, 270, 360, -90, -180, and -270 degrees. For angles not directly supported, a general rotation method is used.
Rotates the position around a specified center of rotation by a given angle in degrees. Supports direct rotation by 0, 90, 180, 270, 360, -90, -180, and -270 degrees. For angles not directly supported, a general rotation method is used.
Value parameters
- angle
-
The angle in degrees to rotate the position by.
- centerOfRotation
-
The center point around which the position is rotated.
Attributes
- Returns
-
A new
Pos
instance after rotation.
Rotates the position around the origin (0,0) by a specified angle in degrees.
Rotates the position around the origin (0,0) by a specified angle in degrees.
Value parameters
- angle
-
The angle in degrees to rotate the position by.
Attributes
- Returns
-
A new
Pos
instance after rotation.
Scales this position relative to a specific point.
Scales this position relative to a specific point.
Value parameters
- horizontalFactor
-
The factor by which to scale the x-coordinate.
- relativityPoint
-
The point relative to which scaling is performed.
- verticalFactor
-
The factor by which to scale the y-coordinate.
Attributes
- Returns
-
A new position after scaling.
Scales the position relative to the origin (0,0) by specified horizontal and vertical factors.
Scales the position relative to the origin (0,0) by specified horizontal and vertical factors.
Value parameters
- horizontalFactor
-
The factor by which the x-coordinate is scaled.
- verticalFactor
-
The factor by which the y-coordinate is scaled.
Attributes
- Returns
-
A new
Pos
instance after scaling.
Inherited methods
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product