struct Sketchbook::Point

Overview

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

Defined in:

sys/point.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(x : Float64, y : Float64) #

[View source]

Instance Method Detail

def *(other : Point) #

Performs component-wise multiplication.


[View source]
def *(factor : Number) #

Performs component-wise multiplication by factor.


[View source]
def +(other : Point) #

[View source]
def -(other : Point) #

Performs component-wise subtraction.


[View source]
def /(factor : Number) #

Performs component-wise division by factor.


[View source]
def <=(other : Point) #

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


[View source]
def clone #

[View source]
def copy_with(x _x = @x, y _y = @y) #

[View source]
def max(other : Point) #

Component-wise Math.max with other.


[View source]
def min(other : Point) #

Component-wise Math.min with other.


[View source]
def vec2 : SF::Vector2i #

Converts this point to SF::Vector2i.


[View source]
def x : Float64 #

def y : Float64 #