struct

Sketchbook::Point

Inherits Struct < Value < Object

Represents a 2D Cartesian point, with an x and y floating point coordinates.

Constructors

new(x : Float64, y : Float64)

Instance methods

*(other : Point)

Performs component-wise multiplication.

*(factor : Number)

Performs component-wise multiplication by factor.

+(other : Point)

Performs component-wise addition.

-(other : Point)

Performs component-wise subtraction.

/(factor : Number)

Performs component-wise division by factor.

<=(other : Point)

Returns whether this point is above and to the left of other point.

clone
copy_with(x _x = @x, y _y = @y)
max(other : Point)

Component-wise Math.max with other.

min(other : Point)

Component-wise Math.min with other.

vec2

Converts this point to SF::Vector2i.

x
y