Pos

smile.modeling.Pos
See thePos companion object
case class Pos(x: Double, y: Double)

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 Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

final inline def *(other: Pos): Pos
final inline def *(other: (Double, Double)): Pos
final inline def *(other: Double): Pos
final inline def +(other: Pos): Pos
final inline def +(other: (Double, Double)): Pos
final inline def -(other: Pos): Pos
final inline def -(other: (Double, Double)): Pos
final inline def /(other: Pos): Pos
final inline def /(other: (Double, Double)): Pos
final inline def /(other: Double): Pos
final inline def centerBetween(destination: Pos): Pos

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.

inline def moveBy(xOffset: Double, yOffset: Double): Pos

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.

def rotateBy(angle: Double, centerOfRotation: Pos): Pos

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.

def rotateByAroundOrigin(angle: Double): Pos

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.

final inline def scaleBy(horizontalFactor: Double, verticalFactor: Double, relativityPoint: Pos): Pos

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.

final inline def scaleByRelativeToOrigin(horizontalFactor: Double, verticalFactor: Double): Pos

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

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product